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

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

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

  • Property svn:keywords set to Id
File size: 65.4 KB
Line 
1/*
2 * $Id: Front_end_allocation.cpp 101 2009-01-15 17:19:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/include/Front_end.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_front_end {
16namespace front_end {
17
18
19
20#undef  FUNCTION
21#define FUNCTION "Front_end::allocation"
22  void Front_end::allocation
23  (
24#ifdef STATISTICS
25   morpheo::behavioural::Parameters_Statistics * param_statistics
26#else
27   void
28#endif
29   )
30  {
31    log_begin(Front_end,FUNCTION);
32
33    _component   = new Component (_usage);
34
35    Entity * entity = _component->set_entity (_name       
36                                              ,"Front_end"
37#ifdef POSITION
38                                              ,COMBINATORY
39#endif
40                                              );
41
42    _interfaces = entity->set_interfaces();
43   
44    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45    {
46      Interface * interface = _interfaces->set_interface(""
47#ifdef POSITION
48                                                         ,IN
49                                                         ,SOUTH,
50                                                         "Generalist interface"
51#endif
52                                                         );
53     
54      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
55      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
56    }
57
58    // ~~~~~[ Interface "icache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59    {
60      ALLOC1_INTERFACE("icache_req",OUT, WEST, _("Instruction cache request."),_param->_nb_context);
61
62      ALLOC1_VALACK_OUT (out_ICACHE_REQ_VAL                   ,VAL);
63      ALLOC1_VALACK_IN  ( in_ICACHE_REQ_ACK                   ,ACK);
64//    ALLOC1_SIGNAL_OUT (out_ICACHE_REQ_THREAD_ID             ,"thread_id"        ,Tcontext_t           ,_param->_size_context_id           );
65      ALLOC1_SIGNAL_OUT (out_ICACHE_REQ_PACKET_ID             ,"packet_id"        ,Tpacket_t            ,_param->_size_ifetch_queue_ptr     );
66      ALLOC1_SIGNAL_OUT (out_ICACHE_REQ_ADDRESS               ,"address"          ,Ticache_instruction_t,_param->_size_instruction_address              );
67      ALLOC1_SIGNAL_OUT (out_ICACHE_REQ_TYPE                  ,"type"             ,Ticache_type_t       ,_param->_size_icache_type          );
68    }
69
70    // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71    {
72      ALLOC1_INTERFACE("icache_rsp",IN , WEST, _("Instruction cache respons."),_param->_nb_context);
73
74      ALLOC1_VALACK_IN  ( in_ICACHE_RSP_VAL                   ,VAL);
75      ALLOC1_VALACK_OUT (out_ICACHE_RSP_ACK                   ,ACK);
76//    ALLOC1_SIGNAL_IN  ( in_ICACHE_RSP_THREAD_ID             ,"thread_id"        ,Tcontext_t           ,_param->_size_context_id           );
77      ALLOC1_SIGNAL_IN  ( in_ICACHE_RSP_PACKET_ID             ,"packet_id"        ,Tpacket_t            ,_param->_size_ifetch_queue_ptr     );
78      ALLOC1_SIGNAL_IN  ( in_ICACHE_RSP_ERROR                 ,"error"            ,Ticache_error_t      ,_param->_size_icache_error         );
79    }
80    {
81      ALLOC2_INTERFACE("icache_rsp",IN , WEST, "Instruction cache respons.",_param->_nb_context,_param->_nb_inst_fetch[it1]);
82
83      _ALLOC2_SIGNAL_IN ( in_ICACHE_RSP_INSTRUCTION           ,"instruction"      ,Ticache_instruction_t,_param->_size_instruction ,_param->_nb_context,_param->_nb_inst_fetch[it1]);
84    }
85
86
87    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88    {
89      ALLOC1_INTERFACE("decod",OUT,EAST,_("Decoded instruction, send to ooo_engine"),_param->_sum_inst_decod);
90
91      ALLOC1_VALACK_OUT (out_DECOD_VAL                        , VAL);
92      ALLOC1_VALACK_IN  ( in_DECOD_ACK                        , ACK);
93      ALLOC1_SIGNAL_OUT (out_DECOD_CONTEXT_ID                 ,"CONTEXT_ID"       ,Tcontext_t           ,_param->_size_context_id            );
94      ALLOC1_SIGNAL_OUT (out_DECOD_DEPTH                      ,"DEPTH"            ,Tdepth_t             ,_param->_size_depth                 );
95      ALLOC1_SIGNAL_OUT (out_DECOD_TYPE                       ,"TYPE"             ,Ttype_t              ,_param->_size_type                  );
96      ALLOC1_SIGNAL_OUT (out_DECOD_OPERATION                  ,"OPERATION"        ,Toperation_t         ,_param->_size_operation             );
97      ALLOC1_SIGNAL_OUT (out_DECOD_NO_EXECUTE                 ,"NO_EXECUTE"       ,Tcontrol_t           ,1                                   );
98      ALLOC1_SIGNAL_OUT (out_DECOD_IS_DELAY_SLOT              ,"IS_DELAY_SLOT"    ,Tcontrol_t           ,1                                   );
99      ALLOC1_SIGNAL_OUT (out_DECOD_ADDRESS                    ,"ADDRESS"          ,Tgeneral_data_t      ,_param->_size_instruction_address   );
100      ALLOC1_SIGNAL_OUT (out_DECOD_HAS_IMMEDIAT               ,"HAS_IMMEDIAT"     ,Tcontrol_t           ,1                                   );
101      ALLOC1_SIGNAL_OUT (out_DECOD_IMMEDIAT                   ,"IMMEDIAT"         ,Tgeneral_data_t      ,_param->_size_general_data          );
102      ALLOC1_SIGNAL_OUT (out_DECOD_READ_RA                    ,"READ_RA"          ,Tcontrol_t           ,1                                   );
103      ALLOC1_SIGNAL_OUT (out_DECOD_NUM_REG_RA                 ,"NUM_REG_RA"       ,Tgeneral_address_t   ,_param->_size_general_register_logic);
104      ALLOC1_SIGNAL_OUT (out_DECOD_READ_RB                    ,"READ_RB"          ,Tcontrol_t           ,1                                   );
105      ALLOC1_SIGNAL_OUT (out_DECOD_NUM_REG_RB                 ,"NUM_REG_RB"       ,Tgeneral_address_t   ,_param->_size_general_register_logic);
106      ALLOC1_SIGNAL_OUT (out_DECOD_READ_RC                    ,"READ_RC"          ,Tcontrol_t           ,1                                   );
107      ALLOC1_SIGNAL_OUT (out_DECOD_NUM_REG_RC                 ,"NUM_REG_RC"       ,Tspecial_address_t   ,_param->_size_special_register_logic);
108      ALLOC1_SIGNAL_OUT (out_DECOD_WRITE_RD                   ,"WRITE_RD"         ,Tcontrol_t           ,1                                   );
109      ALLOC1_SIGNAL_OUT (out_DECOD_NUM_REG_RD                 ,"NUM_REG_RD"       ,Tgeneral_address_t   ,_param->_size_general_register_logic);
110      ALLOC1_SIGNAL_OUT (out_DECOD_WRITE_RE                   ,"WRITE_RE"         ,Tcontrol_t           ,1                                   );
111      ALLOC1_SIGNAL_OUT (out_DECOD_NUM_REG_RE                 ,"NUM_REG_RE"       ,Tspecial_address_t   ,_param->_size_special_register_logic);
112      ALLOC1_SIGNAL_OUT (out_DECOD_EXCEPTION_USE              ,"EXCEPTION_USE"    ,Texception_t         ,_param->_size_exception_use         );
113      ALLOC1_SIGNAL_OUT (out_DECOD_EXCEPTION                  ,"EXCEPTION"        ,Texception_t         ,_param->_size_exception             );
114    }
115   
116    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117    {
118      ALLOC1_INTERFACE("branch_complete",IN,EAST,_("Branch commit"),_param->_nb_inst_branch_complete);
119
120      ALLOC1_VALACK_IN  ( in_BRANCH_COMPLETE_VAL              , VAL);
121      ALLOC1_VALACK_OUT (out_BRANCH_COMPLETE_ACK              , ACK);
122      ALLOC1_SIGNAL_IN  ( in_BRANCH_COMPLETE_CONTEXT_ID       ,"CONTEXT_ID"       ,Tcontext_t           ,_param->_size_context_id);
123      ALLOC1_SIGNAL_IN  ( in_BRANCH_COMPLETE_DEPTH            ,"DEPTH"            ,Tdepth_t             ,_param->_size_depth     );
124      ALLOC1_SIGNAL_IN  ( in_BRANCH_COMPLETE_ADDRESS          ,"ADDRESS"          ,Taddress_t           ,_param->_size_instruction_address);
125      ALLOC1_SIGNAL_IN  ( in_BRANCH_COMPLETE_NO_SEQUENCE      ,"NO_SEQUENCE"      ,Tcontrol_t           ,1                       );
126      ALLOC1_SIGNAL_OUT (out_BRANCH_COMPLETE_MISS_PREDICTION  ,"MISS_PREDICTION"  ,Tcontrol_t           ,1                       );
127    }
128
129   // ~~~~~[ Interface : "commit_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130    {
131      ALLOC_INTERFACE("commit_event",IN,EAST,_("Out Of Order engine have an event"));
132
133      ALLOC_VALACK_IN   ( in_COMMIT_EVENT_VAL                 , VAL);
134      ALLOC_VALACK_OUT  (out_COMMIT_EVENT_ACK                 , ACK);
135      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_CONTEXT_ID          ,"CONTEXT_ID"       ,Tcontext_t           ,_param->_size_context_id);
136      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_DEPTH               ,"DEPTH"            ,Tdepth_t             ,_param->_size_depth     );
137      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_TYPE                ,"TYPE"             ,Tevent_type_t        ,_param->_size_event_type);
138      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_IS_DELAY_SLOT       ,"IS_DELAY_SLOT"    ,Tcontrol_t           ,1                       );
139      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_ADDRESS             ,"ADDRESS"          ,Taddress_t           ,_param->_size_instruction_address   );
140      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_ADDRESS_EPCR        ,"ADDRESS_EPCR"     ,Taddress_t           ,_param->_size_instruction_address   );
141      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_ADDRESS_EEAR_VAL    ,"ADDRESS_EEAR_VAL" ,Tcontrol_t           ,1                       );
142      ALLOC_SIGNAL_IN   ( in_COMMIT_EVENT_ADDRESS_EEAR        ,"ADDRESS_EEAR"     ,Tgeneral_data_t      ,_param->_size_general_data          );
143    }
144
145    // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146    {
147      ALLOC1_INTERFACE("event",OUT,EAST,_("Event interface"),_param->_nb_context);
148
149      ALLOC1_VALACK_OUT (out_EVENT_VAL                        , VAL);
150      ALLOC1_VALACK_IN  ( in_EVENT_ACK                        , ACK);
151      ALLOC1_SIGNAL_OUT (out_EVENT_ADDRESS                    ,"ADDRESS"          ,Taddress_t           ,_param->_size_instruction_address);
152      ALLOC1_SIGNAL_OUT (out_EVENT_ADDRESS_NEXT               ,"ADDRESS_NEXT"     ,Taddress_t           ,_param->_size_instruction_address); 
153      ALLOC1_SIGNAL_OUT (out_EVENT_ADDRESS_NEXT_VAL           ,"ADDRESS_NEXT_VAL" ,Tcontrol_t           ,1                    );
154      ALLOC1_SIGNAL_OUT (out_EVENT_IS_DS_TAKE                 ,"IS_DS_TAKE"       ,Tcontrol_t           ,1                    );
155    }
156
157    // ~~~~~[ Interface "spr_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158    {
159      ALLOC1_INTERFACE("spr_event",OUT,EAST,_("Event interface with the special registerFile"),_param->_nb_context);
160
161      ALLOC1_VALACK_OUT (out_SPR_EVENT_VAL                    , VAL);
162      ALLOC1_VALACK_IN  ( in_SPR_EVENT_ACK                    , ACK);
163      ALLOC1_SIGNAL_OUT (out_SPR_EVENT_EPCR                   ,"EPCR"             ,Tspr_t               ,_param->_size_spr);
164      ALLOC1_SIGNAL_OUT (out_SPR_EVENT_EEAR_WEN               ,"EEAR_WEN"         ,Tcontrol_t           ,1                );
165      ALLOC1_SIGNAL_OUT (out_SPR_EVENT_EEAR                   ,"EEAR"             ,Tspr_t               ,_param->_size_spr);
166      ALLOC1_SIGNAL_OUT (out_SPR_EVENT_SR_DSX                 ,"SR_DSX"           ,Tcontrol_t           ,1                );
167      ALLOC1_SIGNAL_OUT (out_SPR_EVENT_SR_TO_ESR              ,"SR_TO_ESR"        ,Tcontrol_t           ,1                );
168    }                                                                                   
169
170    // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171    {
172      ALLOC1_INTERFACE("nb_inst",IN,EAST,_("Instruction number"),_param->_nb_context);
173
174      ALLOC1_SIGNAL_IN  ( in_NB_INST_COMMIT_ALL               ,"COMMIT_ALL"       ,Tcounter_t           ,_param->_size_nb_inst_commit);
175      ALLOC1_SIGNAL_IN  ( in_NB_INST_COMMIT_MEM               ,"COMMIT_MEM"       ,Tcounter_t           ,_param->_size_nb_inst_commit);
176    }
177
178    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179    {
180      ALLOC1_INTERFACE("depth",OUT,EAST,_("Interface depth"),_param->_nb_context);
181
182      ALLOC1_SIGNAL_OUT (out_DEPTH_MIN                        ,"MIN"              ,Tdepth_t             ,_param->_size_depth);
183      ALLOC1_SIGNAL_OUT (out_DEPTH_MAX                        ,"MAX"              ,Tdepth_t             ,_param->_size_depth);
184      ALLOC1_SIGNAL_OUT (out_DEPTH_FULL                       ,"FULL"             ,Tcontrol_t           ,1);
185    }
186
187    // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
188    {
189      ALLOC1_INTERFACE("spr",IN,EAST,_("Interface with the special registerFile"),_param->_nb_context);
190     
191      ALLOC1_SIGNAL_IN  ( in_SPR_SR_IEE                       ,"SR_IEE"           ,Tcontrol_t           ,1);
192      ALLOC1_SIGNAL_IN  ( in_SPR_SR_EPH                       ,"SR_EPH"           ,Tcontrol_t           ,1);
193    }
194
195    // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
196    {
197      ALLOC1_INTERFACE("interrupt",IN,NORTH,_("Interrupt Exception"),_param->_nb_context);
198
199      ALLOC1_SIGNAL_IN  ( in_INTERRUPT_ENABLE                 ,"ENABLE"           ,Tcontrol_t           ,1);
200    }
201
202    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203    std::string name;
204
205    _component_ifetch_unit = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::Ifetch_unit * [_param->_nb_context];
206   
207    for (uint32_t i=0; i<_param->_nb_context; ++i)
208    {
209      name = _name+"_ifetch_unit_"+toString(i);
210      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
211     
212      _component_ifetch_unit [i] = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::Ifetch_unit
213        (name.c_str()
214#ifdef STATISTICS
215         ,param_statistics
216#endif
217         ,_param->_param_ifetch_unit [i]
218         ,_usage);
219     
220      _component->set_component (_component_ifetch_unit [i]->_component
221#ifdef POSITION
222                                 , 50, 50, 10, 10
223#endif
224                                 );
225    }
226
227    {
228      name = _name+"_prediction_unit";
229      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
230     
231      _component_prediction_unit = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::Prediction_unit
232        (name.c_str()
233#ifdef STATISTICS
234         ,param_statistics
235#endif
236         ,_param->_param_prediction_unit
237         ,_usage);
238     
239      _component->set_component (_component_prediction_unit->_component
240#ifdef POSITION
241                                 , 50, 50, 10, 10
242#endif
243                                 );
244    }
245
246    _component_decod_unit = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Decod_unit * [_param->_nb_decod_unit];
247   
248    for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
249    {
250      name = _name+"_decod_unit_"+toString(i);
251      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
252     
253      _component_decod_unit [i] = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Decod_unit
254        (name.c_str()
255#ifdef STATISTICS
256         ,param_statistics
257#endif
258         ,_param->_param_decod_unit [i]
259         ,_usage);
260     
261      _component->set_component (_component_decod_unit [i]->_component
262#ifdef POSITION
263                                 , 50, 50, 10, 10
264#endif
265                                 );
266    }
267
268    {
269      name = _name+"_context_state";
270      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
271     
272      _component_context_state = new morpheo::behavioural::core::multi_front_end::front_end::context_state::Context_State
273        (name.c_str()
274#ifdef STATISTICS
275         ,param_statistics
276#endif
277         ,_param->_param_context_state
278         ,_usage);
279     
280      _component->set_component (_component_context_state->_component
281#ifdef POSITION
282                                 , 50, 50, 10, 10
283#endif
284                                 );
285    }
286
287    {
288      name = _name+"_glue";
289      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
290     
291      _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::front_end_glue::Front_end_Glue
292        (name.c_str()
293#ifdef STATISTICS
294         ,param_statistics
295#endif
296         ,_param->_param_glue
297         ,_usage);
298     
299      _component->set_component (_component_glue->_component
300#ifdef POSITION
301                                 , 50, 50, 10, 10
302#endif
303                                 );
304    }
305
306   
307    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
308    std::string src,dest;
309
310    // ===================================================================
311    // =====[ ifetch_unit ]===============================================
312    // ===================================================================
313    for (uint32_t i=0; i<_param->_nb_context; ++i)
314    {
315      src = _name+"_ifetch_unit_"+toString(i);
316      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
317           
318      {
319        dest = _name;
320#ifdef POSITION
321        _component->interface_map (src ,"",
322                                   dest,"");
323#endif
324        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
325        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
326      }
327
328      // ~~~~~[ Interface "icache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329      {
330        dest = _name;
331#ifdef POSITION
332        _component->interface_map (src ,"icache_req",
333                                   dest,"icache_req_"+toString(i));
334#endif
335
336        PORT_MAP(_component,src ,"out_ICACHE_REQ_VAL"      ,dest,"out_ICACHE_REQ_"+toString(i)+"_VAL"      );
337        PORT_MAP(_component,src , "in_ICACHE_REQ_ACK"      ,dest, "in_ICACHE_REQ_"+toString(i)+"_ACK"      );
338      //PORT_MAP(_component,src ,"out_ICACHE_REQ_THREAD_ID",dest,"out_ICACHE_REQ_"+toString(i)+"_THREAD_ID");
339        if (_param->_have_port_ifetch_queue_ptr)
340        PORT_MAP(_component,src ,"out_ICACHE_REQ_PACKET_ID",dest,"out_ICACHE_REQ_"+toString(i)+"_PACKET_ID");
341        PORT_MAP(_component,src ,"out_ICACHE_REQ_ADDRESS"  ,dest,"out_ICACHE_REQ_"+toString(i)+"_ADDRESS"  );
342        PORT_MAP(_component,src ,"out_ICACHE_REQ_TYPE"     ,dest,"out_ICACHE_REQ_"+toString(i)+"_TYPE"     );
343      }
344
345      // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
346      {
347        dest = _name;
348#ifdef POSITION
349        _component->interface_map (src ,"icache_rsp",
350                                   dest,"icache_rsp_"+toString(i));
351#endif
352
353        PORT_MAP(_component,src , "in_ICACHE_RSP_VAL"        ,dest, "in_ICACHE_RSP_"+toString(i)+"_VAL"        );
354        PORT_MAP(_component,src ,"out_ICACHE_RSP_ACK"        ,dest,"out_ICACHE_RSP_"+toString(i)+"_ACK"        );
355//      PORT_MAP(_component,src , "in_ICACHE_RSP_THREAD_ID"  ,dest, "in_ICACHE_RSP_"+toString(i)+"_THREAD_ID"  );
356        if (_param->_have_port_ifetch_queue_ptr)
357        PORT_MAP(_component,src , "in_ICACHE_RSP_PACKET_ID"  ,dest, "in_ICACHE_RSP_"+toString(i)+"_PACKET_ID"  );
358        PORT_MAP(_component,src , "in_ICACHE_RSP_ERROR"      ,dest, "in_ICACHE_RSP_"+toString(i)+"_ERROR"      );
359
360        for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; ++j)
361          {
362#ifdef POSITION
363            _component->interface_map (src ,"icache_rsp_"+toString(j),
364                                       dest,"icache_rsp_"+toString(i)+"_"+toString(j));
365#endif
366           
367            PORT_MAP(_component,src , "in_ICACHE_RSP_"+toString(j)+"_INSTRUCTION",dest, "in_ICACHE_RSP_"+toString(i)+"_"+toString(j)+"_INSTRUCTION");
368          }
369      }
370
371      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372      {
373        dest = _name+"_prediction_unit";
374#ifdef POSITION
375        _component->interface_map (src ,"predict"
376                                   dest,"predict_"+toString(i));
377#endif
378       
379        COMPONENT_MAP(_component,src ,"out_PREDICT_VAL"                        ,dest, "in_PREDICT_"+toString(i)+"_VAL"                        );
380        COMPONENT_MAP(_component,src , "in_PREDICT_ACK"                        ,dest,"out_PREDICT_"+toString(i)+"_ACK"                        );
381        COMPONENT_MAP(_component,src ,"out_PREDICT_PC_PREVIOUS"                ,dest, "in_PREDICT_"+toString(i)+"_PC_PREVIOUS"                );
382        COMPONENT_MAP(_component,src ,"out_PREDICT_PC_CURRENT"                 ,dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT"                 );
383        COMPONENT_MAP(_component,src ,"out_PREDICT_PC_CURRENT_IS_DS_TAKE"      ,dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE"      );
384        COMPONENT_MAP(_component,src , "in_PREDICT_PC_NEXT"                    ,dest,"out_PREDICT_"+toString(i)+"_PC_NEXT"                    );
385        COMPONENT_MAP(_component,src , "in_PREDICT_PC_NEXT_IS_DS_TAKE"         ,dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         );
386        if (_param->_have_port_inst_ifetch_ptr)
387        COMPONENT_MAP(_component,src , "in_PREDICT_INST_IFETCH_PTR"            ,dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            );
388        COMPONENT_MAP(_component,src , "in_PREDICT_BRANCH_STATE"               ,dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
389        if (_param->_have_port_depth)
390        COMPONENT_MAP(_component,src , "in_PREDICT_BRANCH_UPDATE_PREDICTION_ID",dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
391       
392        for (uint32_t j=0; j<_param->_nb_inst_fetch[i]; ++j)
393          {
394#ifdef POSITION
395            _component->interface_map (src ,"predict_"+toString(j)
396                                       dest,"predict_"+toString(i)+"_"+toString(j));
397#endif
398           
399            COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_INSTRUCTION_ENABLE",
400                                     dest,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE");
401          }
402      }
403
404      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
405      {
406        uint32_t num_decod_unit = _param->_link_context_to_decod_unit[i];
407        uint32_t num_context;
408
409        for (num_context=0; num_context<_param->_decod_unit_nb_context[num_decod_unit]; num_context ++)
410          if (_param->_translate_context_id_from_decod_unit [num_decod_unit][num_context] == i)
411            break;
412
413        dest = _name+"_decod_unit_"+toString(num_decod_unit);
414#ifdef POSITION
415        _component->interface_map (src ,"decod"
416                                   dest,"ifetch_"+toString(num_context));
417#endif
418       
419        ////out_DECOD_CONTEXT_ID
420
421        COMPONENT_MAP(_component,src ,"out_DECOD_ADDRESS"                    ,dest, "in_IFETCH_"+toString(num_context)+"_ADDRESS"                    );
422        if (_param->_have_port_inst_ifetch_ptr)
423        COMPONENT_MAP(_component,src ,"out_DECOD_INST_IFETCH_PTR"            ,dest, "in_IFETCH_"+toString(num_context)+"_INST_IFETCH_PTR"            );
424        COMPONENT_MAP(_component,src ,"out_DECOD_BRANCH_STATE"               ,dest, "in_IFETCH_"+toString(num_context)+"_BRANCH_STATE"               );
425        if (_param->_have_port_depth)
426        COMPONENT_MAP(_component,src ,"out_DECOD_BRANCH_UPDATE_PREDICTION_ID",dest, "in_IFETCH_"+toString(num_context)+"_BRANCH_UPDATE_PREDICTION_ID");
427        COMPONENT_MAP(_component,src ,"out_DECOD_EXCEPTION"                  ,dest, "in_IFETCH_"+toString(num_context)+"_EXCEPTION"                  );
428
429        for (uint32_t j=0; j<_param->_nb_inst_fetch [i];++j)
430          {
431            dest = _name+"_decod_unit_"+toString(num_decod_unit);
432#ifdef POSITION
433            _component->interface_map (src ,"decod_"+toString(j)
434                                       dest,"ifetch_"+toString(num_context)+"_"+toString(j));
435#endif
436       
437            COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(j)+                          "_VAL"        ,
438                                     dest, "in_IFETCH_"+toString(num_context)+"_"+toString(j)+"_VAL"        );
439            COMPONENT_MAP(_component,src , "in_DECOD_" +toString(j)+                          "_ACK"        ,
440                                     dest,"out_IFETCH_"+toString(num_context)+"_"+toString(j)+"_ACK"        );
441            COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(j)+                          "_INSTRUCTION",
442                                     dest, "in_IFETCH_"+toString(num_context)+"_"+toString(j)+"_INSTRUCTION");
443          }
444      }
445
446      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
447      {
448        dest = _name+"_glue";
449#ifdef POSITION
450        _component->interface_map (src ,"event",
451                                   dest,"event_"+toString(i));
452#endif
453
454        COMPONENT_MAP(_component,src , "in_EVENT_VAL"             ,
455                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_VAL"             );
456        COMPONENT_MAP(_component,src ,"out_EVENT_ACK"             ,
457                                 dest, "in_EVENT_"+toString(i)+"_IFETCH_UNIT_ACK"             );
458        COMPONENT_MAP(_component,src , "in_EVENT_ADDRESS"         ,
459                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_ADDRESS"         );
460        COMPONENT_MAP(_component,src , "in_EVENT_ADDRESS_NEXT"    ,
461                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_ADDRESS_NEXT"    );
462        COMPONENT_MAP(_component,src , "in_EVENT_ADDRESS_NEXT_VAL",
463                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_ADDRESS_NEXT_VAL");
464        COMPONENT_MAP(_component,src , "in_EVENT_IS_DS_TAKE"      ,
465                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_IS_DS_TAKE"      );
466      }
467    }
468
469    // ===================================================================
470    // =====[ prediction_unit ]===========================================
471    // ===================================================================
472    {
473      src = _name+"_prediction_unit";
474      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
475           
476      {
477        dest = _name;
478#ifdef POSITION
479        _component->interface_map (src ,"",
480                                   dest,"");
481#endif
482        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
483        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
484      }
485
486      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
487      //   in_PREDICT_VAL                         - component_ifetch_unit
488      //  out_PREDICT_ACK                         - component_ifetch_unit
489      //   in_PREDICT_PC_PREVIOUS                 - component_ifetch_unit
490      //   in_PREDICT_PC_CURRENT                  - component_ifetch_unit
491      //   in_PREDICT_PC_CURRENT_IS_DS_TAKE       - component_ifetch_unit
492      //  out_PREDICT_PC_NEXT                     - component_ifetch_unit
493      //  out_PREDICT_PC_NEXT_IS_DS_TAKE          - component_ifetch_unit
494      //  out_PREDICT_INSTRUCTION_ENABLE          - component_ifetch_unit
495      //  out_PREDICT_INST_IFETCH_PTR             - component_ifetch_unit
496      //  out_PREDICT_BRANCH_STATE                - component_ifetch_unit
497      //  out_PREDICT_BRANCH_UPDATE_PREDICTION_ID - component_ifetch_unit
498
499      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
500      //   in_DECOD_VAL                           - component_decod_unit
501      //  out_DECOD_ACK                           - component_decod_unit
502      //   in_DECOD_CONTEXT_ID                    - component_decod_unit
503      //   in_DECOD_MATCH_INST_IFETCH_PTR         - component_decod_unit
504      //   in_DECOD_BRANCH_STATE                  - component_decod_unit
505      //   in_DECOD_BRANCH_UPDATE_PREDICTION_ID   - component_decod_unit
506      //   in_DECOD_BRANCH_CONDITION              - component_decod_unit
507      //   in_DECOD_BRANCH_DIRECTION              - component_decod_unit
508      //   in_DECOD_ADDRESS_SRC                   - component_decod_unit
509      //   in_DECOD_ADDRESS_DEST                  - component_decod_unit
510
511      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
512      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
513        {
514          dest = _name+"_glue";
515#ifdef POSITION
516          _component->interface_map (src ,"branch_complete_"+toString(i),
517                                     dest,"branch_complete_"+toString(i));
518#endif
519
520          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+                "_VAL"            ,
521                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTION_UNIT_VAL"            );
522          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+                "_ACK"            ,
523                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTION_UNIT_ACK"            );
524          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+                "_MISS_PREDICTION",
525                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTION_UNIT_MISS_PREDICTION");
526
527          dest = _name;
528#ifdef POSITION
529          _component->interface_map (src ,"branch_complete_"+toString(i),
530                                     dest,"branch_complete_"+toString(i));
531#endif
532
533          if (_param->_have_port_context_id)
534          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID",
535                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID");
536          if (_param->_have_port_depth)
537          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     ,
538                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     );
539          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"   ,
540                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"   );
541          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE",
542                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE");
543
544          dest = _name+"_context_state";
545#ifdef POSITION
546          _component->interface_map (src ,"branch_complete_"+toString(i),
547                                     dest,"branch_complete_"+toString(i));
548#endif
549
550          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE"        ,
551                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_TAKE"        );
552          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC" ,
553                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC" );
554          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST",
555                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST");
556        }
557
558      // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
559      for (uint32_t i=0; i<_param->_nb_context; ++i)
560        {
561          dest = _name+"_context_state";
562#ifdef POSITION
563          _component->interface_map (src ,"branch_event_"+toString(i),
564                                     dest,"branch_event_"+toString(i));
565#endif
566
567          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_VAL"             ,
568                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_VAL"             );
569          COMPONENT_MAP(_component,src , "in_BRANCH_EVENT_"+toString(i)+"_ACK"             ,
570                                   dest,"out_BRANCH_EVENT_"+toString(i)+"_ACK"             );
571//        COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_CONTEXT_ID"      ,
572//                                 dest, "in_BRANCH_EVENT_"+toString(i)+"_CONTEXT_ID"      );
573          if (_param->_have_port_depth)
574          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH"           ,
575                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_DEPTH"           );
576//        COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_MISS_PREDICTION" ,
577//                                 dest, "in_BRANCH_EVENT_"+toString(i)+"_MISS_PREDICTION" );
578          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     ,
579                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     );
580          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL",
581                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL");
582          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    ,
583                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    );
584        }
585
586      // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
587      for (uint32_t i=0; i<_param->_nb_context; ++i)
588        {
589          dest = _name+"_glue";
590#ifdef POSITION
591          _component->interface_map (src ,"event_"+toString(i),
592                                     dest,"event_"+toString(i));
593#endif
594          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_VAL"  ,
595                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_VAL"  );
596          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+                "_ACK"  ,
597                                   dest, "in_EVENT_"+toString(i)+"_PREDICTION_UNIT_ACK"  );
598          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_TYPE" ,
599                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_TYPE" );
600          if (_param->_have_port_depth)
601          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_DEPTH",
602                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_DEPTH");
603        }
604
605      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
606      for (uint32_t i=0; i<_param->_nb_context; ++i)
607        {
608          dest = _name+"_glue";
609#ifdef POSITION
610          _component->interface_map (src ,"depth_"+toString(i),
611                                     dest,"depth_"+toString(i));
612#endif
613
614          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_VAL",
615                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_VAL");
616          if (_param->_have_port_depth)
617            {
618          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_CURRENT",
619                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_CURRENT");
620          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MIN"    ,
621                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MIN"    );
622          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MAX"    ,
623                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MAX"    );
624            }
625          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_FULL"   ,
626                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_FULL"   );
627        }
628    }
629
630    // ===================================================================
631    // =====[ decod_unit ]================================================
632    // ===================================================================
633    {
634      uint32_t x=0;
635    for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
636    {
637      src = _name+"_decod_unit_"+toString(i);
638      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
639           
640      {
641        dest = _name;
642#ifdef POSITION
643        _component->interface_map (src ,"",
644                                   dest,"");
645#endif
646        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
647        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
648      }
649
650      // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
651      //   in_IFETCH_VAL                         - component_ifetch_unit
652      //  out_IFETCH_ACK                         - component_ifetch_unit
653      //   in_IFETCH_INSTRUCTION                 - component_ifetch_unit
654      //   in_IFETCH_CONTEXT_ID                  - component_ifetch_unit
655      //   in_IFETCH_ADDRESS                     - component_ifetch_unit
656      //// in_IFETCH_ADDRESS_NEXT                - component_ifetch_unit
657      //   in_IFETCH_INST_IFETCH_PTR             - component_ifetch_unit
658      //   in_IFETCH_BRANCH_STATE                - component_ifetch_unit
659      //   in_IFETCH_BRANCH_UPDATE_PREDICTION_ID - component_ifetch_unit
660      //   in_IFETCH_EXCEPTION                   - component_ifetch_unit
661
662      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
663        {
664          dest = _name+"_glue";
665#ifdef POSITION
666          _component->interface_map (src ,"ifetch_"+toString(j),
667                                     dest,"ifetch_"+toString(i)+"_"+toString(j));
668#endif
669     
670          if (_param->_have_port_context_id)
671          COMPONENT_MAP(_component,src , "in_IFETCH_"+toString(j)                           +"_CONTEXT_ID",
672                                   dest,"out_IFETCH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_CONTEXT_ID");
673        }
674
675      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
676      for (uint32_t j=0; j<_param->_nb_inst_decod [i]; ++j)
677        {
678          dest = _name;
679#ifdef POSITION
680          _component->interface_map (src ,"decod_"+toString(j),
681                                     dest,"decod_"+toString(x));
682#endif
683
684         
685          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_VAL"          ,
686                              dest,"out_DECOD_"+toString(x)+"_VAL"          );
687          PORT_MAP(_component,src , "in_DECOD_"+toString(j)+"_ACK"          ,
688                              dest, "in_DECOD_"+toString(x)+"_ACK"          );
689          if (_param->_have_port_depth)
690          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_DEPTH"        ,
691                              dest,"out_DECOD_"+toString(x)+"_DEPTH"        );
692          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_TYPE"         ,
693                              dest,"out_DECOD_"+toString(x)+"_TYPE"         );
694          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_OPERATION"    ,
695                              dest,"out_DECOD_"+toString(x)+"_OPERATION"    );
696          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NO_EXECUTE"   ,
697                              dest,"out_DECOD_"+toString(x)+"_NO_EXECUTE"   );
698          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IS_DELAY_SLOT",
699                              dest,"out_DECOD_"+toString(x)+"_IS_DELAY_SLOT");
700          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_ADDRESS"      ,
701                              dest,"out_DECOD_"+toString(x)+"_ADDRESS"      );
702          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_HAS_IMMEDIAT" ,
703                              dest,"out_DECOD_"+toString(x)+"_HAS_IMMEDIAT" );
704          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IMMEDIAT"     ,
705                              dest,"out_DECOD_"+toString(x)+"_IMMEDIAT"     );
706          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RA"      ,
707                              dest,"out_DECOD_"+toString(x)+"_READ_RA"      );
708          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RA"   ,
709                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RA"   );
710          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RB"      ,
711                              dest,"out_DECOD_"+toString(x)+"_READ_RB"      );
712          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RB"   ,
713                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RB"   );
714          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RC"      ,
715                              dest,"out_DECOD_"+toString(x)+"_READ_RC"      );
716          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RC"   ,
717                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RC"   );
718          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_WRITE_RD"     ,
719                              dest,"out_DECOD_"+toString(x)+"_WRITE_RD"     );
720          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RD"   ,
721                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RD"   );
722          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_WRITE_RE"     ,
723                              dest,"out_DECOD_"+toString(x)+"_WRITE_RE"     );
724          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RE"   ,
725                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RE"   );
726          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_EXCEPTION_USE",
727                              dest,"out_DECOD_"+toString(x)+"_EXCEPTION_USE");
728          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_EXCEPTION"    ,
729                              dest,"out_DECOD_"+toString(x)+"_EXCEPTION"    );
730
731          dest = _name+"_glue";
732#ifdef POSITION
733          _component->interface_map (src ,"decod_"+toString(j),
734                                     dest,"decod_"+toString(i)+"_"+toString(j));
735#endif
736
737          if (_param->_have_port_context_id)
738          COMPONENT_MAP(_component,src ,"out_DECOD_"+toString(j)+                           "_CONTEXT_ID"   ,
739                                   dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_CONTEXT_ID"   );
740
741          x++;
742        }
743     
744      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
745      for (uint32_t j=0; j<_param->_nb_inst_decod[i]; ++j)
746        {
747          dest = _name+"_prediction_unit";
748#ifdef POSITION
749          _component->interface_map (src ,"predict_"+toString(j),
750                                     dest,"decod_"+toString(i)+"_"+toString(j));
751#endif
752
753          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_VAL"                        ,
754                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_VAL"                        );
755          COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_ACK"                        ,
756                                   dest,"out_DECOD_"  +toString(i)+"_"+toString(j)+"_ACK"                        );
757          if (_param->_have_port_context_id)
758          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_CONTEXT_ID"                 ,
759                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 );
760          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_MATCH_INST_IFETCH_PTR"      ,
761                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      );
762          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_STATE"               ,
763                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
764          if (_param->_have_port_depth)
765          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_UPDATE_PREDICTION_ID",
766                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
767          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_CONDITION"           ,
768                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           );
769          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_DIRECTION"           ,
770                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           );
771//        COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_STACK_WRITE"         ,
772//                                 dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_STACK_WRITE"         );
773          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_ADDRESS_SRC"                ,
774                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                );
775          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_ADDRESS_DEST"               ,
776                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               );
777//        COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_CAN_CONTINUE"               ,
778//                                 dest,"out_DECOD_"  +toString(i)+"_"+toString(j)+"_CAN_CONTINUE"               );
779
780        }
781
782      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
783      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
784        {
785 //           uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
786
787          dest = _name+"_glue";
788#ifdef POSITION
789          _component->interface_map (src ,"depth_"+toString(j),
790                                     dest,"depth_"+toString(j));
791#endif
792
793          if (_param->_have_port_depth)
794            {
795          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MIN",
796                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MIN");
797          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MAX",
798                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MAX");
799            } 
800          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_FULL",
801                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_FULL");
802         
803        }
804
805      // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
806      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
807        {
808          uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
809
810          dest = _name+"_context_state";
811#ifdef POSITION
812          _component->interface_map (src ,"nb_inst_"+toString(j),
813                                     dest,"nb_inst_"+toString(y));
814#endif
815
816          COMPONENT_MAP(_component,src ,"out_NB_INST_"+toString(j)+"_DECOD_ALL",
817                                   dest, "in_NB_INST_"+toString(y)+"_DECOD_ALL");
818        }
819
820      // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
821      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
822        {
823          uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
824         
825          dest = _name+"_context_state";
826#ifdef POSITION
827          _component->interface_map (src ,"context_"+toString(j),
828                                     dest,"context_"+toString(y));
829#endif
830
831          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+"_DECOD_ENABLE",
832                                   dest,"out_CONTEXT_"+toString(y)+"_DECOD_ENABLE");
833
834          dest = _name+"_glue";
835#ifdef POSITION
836          _component->interface_map (src ,"context_"+toString(j),
837                                     dest,"context_"+toString(i)+"_"+toString(j));
838#endif
839
840          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+                           "_DEPTH_VAL",
841                                   dest,"out_CONTEXT_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_DEPTH_VAL");
842          if (_param->_have_port_depth)
843          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+                           "_DEPTH",
844                                   dest,"out_CONTEXT_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_DEPTH");
845        }
846
847                                                                                     
848      // ~~~~~[ Interface : "context_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
849      {
850        dest = _name+"_context_state";
851#ifdef POSITION
852        _component->interface_map (src ,"context_event",
853                                   dest,"decod_event_"+toString(i));
854#endif
855     
856        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_VAL"          ,dest, "in_DECOD_EVENT_"+toString(i)+"_VAL"          );
857        COMPONENT_MAP(_component,src , "in_CONTEXT_EVENT_ACK"          ,dest,"out_DECOD_EVENT_"+toString(i)+"_ACK"          );
858        if (_param->_have_port_context_id)
859        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_CONTEXT_ID"   ,dest, "in_DECOD_EVENT_"+toString(i)+"_CONTEXT_ID"   );
860        if (_param->_have_port_depth)
861        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_DEPTH"        ,dest, "in_DECOD_EVENT_"+toString(i)+"_DEPTH"        );
862        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_TYPE"         ,dest, "in_DECOD_EVENT_"+toString(i)+"_TYPE"         );
863        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_IS_DELAY_SLOT",dest, "in_DECOD_EVENT_"+toString(i)+"_IS_DELAY_SLOT");
864        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS"      ,dest, "in_DECOD_EVENT_"+toString(i)+"_ADDRESS"      );
865        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS_EPCR" ,dest, "in_DECOD_EVENT_"+toString(i)+"_ADDRESS_EPCR" );
866      }
867    }
868    }
869
870    // ===================================================================
871    // =====[ context_state ]=============================================
872    // ===================================================================
873    {
874      src = _name+"_context_state";
875      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
876           
877      {
878        dest = _name;
879#ifdef POSITION
880        _component->interface_map (src ,"",
881                                   dest,"");
882#endif
883        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
884        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
885      }
886
887    // ~~~~~[ Interface : "decod_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
888      //   in_DECOD_EVENT_VAL                    - component_decod_unit
889      //  out_DECOD_EVENT_ACK                    - component_decod_unit
890      //   in_DECOD_EVENT_CONTEXT_ID             - component_decod_unit
891      //   in_DECOD_EVENT_DEPTH                  - component_decod_unit
892      //   in_DECOD_EVENT_TYPE                   - component_decod_unit
893      //   in_DECOD_EVENT_IS_DELAY_SLOT          - component_decod_unit
894      //   in_DECOD_EVENT_ADDRESS                - component_decod_unit
895      //   in_DECOD_EVENT_ADDRESS_EPCR           - component_decod_unit
896
897      // ~~~~~[ Interface : "commit_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
898      {
899        dest = _name;
900#ifdef POSITION
901        _component->interface_map (src ,"commit_event",
902                                   dest,"commit_event");
903#endif
904       
905        PORT_MAP(_component,src , "in_COMMIT_EVENT_VAL"             ,
906                            dest, "in_COMMIT_EVENT_VAL"             );
907        PORT_MAP(_component,src ,"out_COMMIT_EVENT_ACK"             ,
908                            dest,"out_COMMIT_EVENT_ACK"             );
909        if (_param->_have_port_context_id)
910        PORT_MAP(_component,src , "in_COMMIT_EVENT_CONTEXT_ID"      ,
911                            dest, "in_COMMIT_EVENT_CONTEXT_ID"      );
912        if (_param->_have_port_depth)
913        PORT_MAP(_component,src , "in_COMMIT_EVENT_DEPTH"           ,
914                            dest, "in_COMMIT_EVENT_DEPTH"           );
915        PORT_MAP(_component,src , "in_COMMIT_EVENT_TYPE"            ,
916                            dest, "in_COMMIT_EVENT_TYPE"            );
917        PORT_MAP(_component,src , "in_COMMIT_EVENT_IS_DELAY_SLOT"   ,
918                            dest, "in_COMMIT_EVENT_IS_DELAY_SLOT"   );
919        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS"         ,
920                            dest, "in_COMMIT_EVENT_ADDRESS"         );
921        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EPCR"    ,
922                            dest, "in_COMMIT_EVENT_ADDRESS_EPCR"    );
923        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EEAR_VAL",
924                            dest, "in_COMMIT_EVENT_ADDRESS_EEAR_VAL");
925        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EEAR"    ,
926                            dest, "in_COMMIT_EVENT_ADDRESS_EEAR"    );
927      }
928
929      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
930      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
931        {
932          dest = _name+"_glue";
933#ifdef POSITION
934          _component->interface_map (src ,"branch_complete_"+toString(i),
935                                     dest,"branch_complete_"+toString(i));
936#endif
937
938          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+              "_VAL"            ,
939                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_VAL"            );
940          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+              "_ACK"            ,
941                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_ACK"            );
942          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+              "_MISS_PREDICTION",
943                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_MISS_PREDICTION");
944
945          dest = _name;
946#ifdef POSITION
947          _component->interface_map (src ,"branch_complete_"+toString(i),
948                                     dest,"branch_complete_"+toString(i));
949#endif
950
951          if (_param->_have_port_context_id)
952          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID",
953                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID");
954          if (_param->_have_port_depth)
955          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     ,
956                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     );
957
958          //   in_BRANCH_COMPLETE_TAKE               - component_prediction_unit
959          //   in_BRANCH_COMPLETE_ADDRESS_SRC        - component_prediction_unit
960          //   in_BRANCH_COMPLETE_ADDRESS_DEST       - component_prediction_unit
961      }
962
963      // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
964      //   in_NB_INST_DECOD_ALL                  - component_decod_unit
965
966      for (uint32_t i=0; i<_param->_nb_context; ++i)
967        {
968          dest = _name;
969#ifdef POSITION
970          _component->interface_map (src ,"nb_inst",
971                                     dest,"nb_inst");
972#endif
973         
974          PORT_MAP(_component,src , "in_NB_INST_"+toString(i)+"_COMMIT_ALL",
975                              dest, "in_NB_INST_"+toString(i)+"_COMMIT_ALL");
976          PORT_MAP(_component,src , "in_NB_INST_"+toString(i)+"_COMMIT_MEM",
977                              dest, "in_NB_INST_"+toString(i)+"_COMMIT_MEM");
978      }
979
980      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
981      for (uint32_t i=0; i<_param->_nb_context; ++i)
982        {
983          dest = _name+"_glue";
984#ifdef POSITION
985          _component->interface_map (src ,"event_"+toString(i),
986                                     dest,"event_"+toString(i));
987#endif
988
989          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_VAL"    ,
990                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_VAL"    );
991          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+              "_ACK"    ,
992                                   dest,"out_EVENT_"+toString(i)+"_CONTEXT_STATE_ACK"    );
993          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS",
994                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS");
995          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS_NEXT"    ,
996                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS_NEXT"    ); 
997          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS_NEXT_VAL",
998                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS_NEXT_VAL");
999          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_IS_DS_TAKE"      ,
1000                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_IS_DS_TAKE"      );
1001          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_TYPE"            ,
1002                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_TYPE"            );
1003          if (_param->_have_port_depth)
1004          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_DEPTH"           ,
1005                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_DEPTH"           );
1006        }
1007
1008      // ~~~~~[ Interface "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1009      for (uint32_t i=0; i<_param->_nb_context; ++i)
1010        {
1011          dest = _name;
1012#ifdef POSITION
1013          _component->interface_map (src ,"spr_event_"+toString(i),
1014                                     dest,"spr_event_"+toString(i));
1015#endif
1016
1017          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_VAL"      ,
1018                              dest,"out_SPR_EVENT_"+toString(i)+"_VAL"      );
1019          PORT_MAP(_component,src , "in_SPR_EVENT_"+toString(i)+"_ACK"      ,
1020                              dest, "in_SPR_EVENT_"+toString(i)+"_ACK"      );
1021          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EPCR"     ,
1022                              dest,"out_SPR_EVENT_"+toString(i)+"_EPCR"     );
1023          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EEAR"     ,
1024                              dest,"out_SPR_EVENT_"+toString(i)+"_EEAR"     );
1025          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EEAR_WEN" ,
1026                              dest,"out_SPR_EVENT_"+toString(i)+"_EEAR_WEN" );
1027          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_SR_DSX"   ,
1028                              dest,"out_SPR_EVENT_"+toString(i)+"_SR_DSX"   );
1029          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_SR_TO_ESR",
1030                              dest,"out_SPR_EVENT_"+toString(i)+"_SR_TO_ESR");
1031        }
1032
1033      // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1034      //  out_CONTEXT_DECOD_ENABLE               - component_decod_unit
1035
1036      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1037      for (uint32_t i=0; i<_param->_nb_context; ++i)
1038        {
1039          dest = _name+"_glue";
1040#ifdef POSITION
1041          _component->interface_map (src ,"depth_"+toString(i),
1042                                     dest,"depth_"+toString(i));
1043#endif
1044
1045          if (_param->_have_port_depth)
1046          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(i)+              "_MIN",
1047                                   dest,"out_DEPTH_"+toString(i)+"_CONTEXT_STATE_MIN");
1048        }
1049
1050      // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1051      for (uint32_t i=0; i<_param->_nb_context; ++i)
1052        {
1053          dest = _name;
1054#ifdef POSITION
1055          _component->interface_map (src ,"spr_"+toString(i),
1056                                     dest,"spr_"+toString(i));
1057#endif
1058         
1059          PORT_MAP(_component,src , "in_SPR_"+toString(i)+"_SR_IEE",
1060                              dest, "in_SPR_"+toString(i)+"_SR_IEE");
1061          PORT_MAP(_component,src , "in_SPR_"+toString(i)+"_SR_EPH",
1062                              dest, "in_SPR_"+toString(i)+"_SR_EPH");
1063        }
1064
1065      // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1066      for (uint32_t i=0; i<_param->_nb_context; ++i)
1067        {
1068          dest = _name;
1069#ifdef POSITION
1070          _component->interface_map (src ,"interrupt_"+toString(i),
1071                                     dest,"interrupt_"+toString(i));
1072#endif
1073         
1074          PORT_MAP(_component,src , "in_INTERRUPT_"+toString(i)+"_ENABLE",
1075                              dest, "in_INTERRUPT_"+toString(i)+"_ENABLE");
1076        }
1077
1078    }
1079   
1080    // ===================================================================
1081    // =====[ glue ]======================================================
1082    // ===================================================================
1083    {
1084      src = _name+"_glue";
1085      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
1086           
1087      {
1088        dest = _name;
1089#ifdef POSITION
1090        _component->interface_map (src ,"",
1091                                   dest,"");
1092#endif
1093        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
1094        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
1095      }
1096     
1097      // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098      // out_IFETCH_DECOD_UNIT_CONTEXT_ID                       - component_decod_unit
1099     
1100      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101      uint32_t x=0;
1102      for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
1103        for (uint32_t j=0; j<_param->_nb_inst_decod[i];++j)
1104          {
1105            dest = _name;
1106#ifdef POSITION
1107            _component->interface_map (src ,"decod_"+toString(i)+"_"+toString(j),
1108                                       dest,"decod_"+toString(x));
1109#endif
1110           
1111            if (_param->_have_port_context_id)
1112            PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID",
1113                                dest,"out_DECOD_"+toString(x)+                "_CONTEXT_ID");
1114            x++;
1115          }
1116      //  in_DECOD_DECOD_UNIT_CONTEXT_ID                        - component_decod_unit
1117   
1118      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1119      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
1120        {
1121          dest = _name;
1122#ifdef POSITION
1123          _component->interface_map (src ,"branch_complete_"+toString(i),
1124                                     dest,"branch_complete_"+toString(i));
1125#endif
1126
1127          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            ,
1128                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            );
1129          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            ,
1130                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            );
1131          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION",
1132                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION");
1133        }
1134     
1135      //  out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL               - component_prediction_unit
1136      //   in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK               - component_prediction_unit
1137      //   in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION   - component_prediction_unit
1138      //  out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                 - component_context_state
1139      //   in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                 - component_context_state
1140      //  out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION     - component_context_state
1141
1142      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1143      for (uint32_t i=0; i<_param->_nb_context; ++i)
1144        {
1145          dest = _name;
1146#ifdef POSITION
1147          _component->interface_map (src ,"event_"+toString(i),
1148                                     dest,"event_"+toString(i));
1149#endif
1150
1151          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_VAL"             ,
1152                              dest,"out_EVENT_"+toString(i)+"_VAL"             );
1153          PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_ACK"             ,
1154                              dest, "in_EVENT_"+toString(i)+"_ACK"             );
1155          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS"         ,
1156                              dest,"out_EVENT_"+toString(i)+"_ADDRESS"         );
1157          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT"    ,
1158                              dest,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT"    );
1159          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT_VAL",
1160                              dest,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT_VAL");
1161          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_IS_DS_TAKE"      ,
1162                              dest,"out_EVENT_"+toString(i)+"_IS_DS_TAKE"      );
1163        }
1164
1165      //  out_EVENT_IFETCH_UNIT_VAL                             - component_ifetch_unit
1166      //   in_EVENT_IFETCH_UNIT_ACK                             - component_ifetch_unit
1167      //  out_EVENT_IFETCH_UNIT_ADDRESS                         - component_ifetch_unit
1168      //  out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                    - component_ifetch_unit
1169      //  out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL                - component_ifetch_unit
1170      //   in_EVENT_IFETCH_UNIT_IS_DS_TAKE                      - component_ifetch_unit
1171      //  out_EVENT_PREDICTION_UNIT_VAL                         - component_prediction_unit
1172      //   in_EVENT_PREDICTION_UNIT_ACK                         - component_prediction_unit
1173      //  out_EVENT_PREDICTION_UNIT_TYPE                        - component_prediction_unit
1174      //  out_EVENT_PREDICTION_UNIT_DEPTH                       - component_prediction_unit
1175      //   in_EVENT_CONTEXT_STATE_VAL                           - component_context_state
1176      //  out_EVENT_CONTEXT_STATE_ACK                           - component_context_state
1177      //   in_EVENT_CONTEXT_STATE_ADDRESS                       - component_context_state
1178      //   in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                  - component_context_state
1179      //   in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL              - component_context_state
1180      //   in_EVENT_CONTEXT_STATE_IS_DS_TAKE                    - component_context_state
1181      //   in_EVENT_CONTEXT_STATE_TYPE                          - component_context_state
1182      //   in_EVENT_CONTEXT_STATE_DEPTH                         - component_context_state
1183
1184      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
1185      for (uint32_t i=0; i<_param->_nb_context; ++i)
1186        {
1187          dest = _name;
1188#ifdef POSITION
1189          _component->interface_map (src ,"depth_"+toString(i),
1190                                     dest,"depth_"+toString(i));
1191#endif
1192
1193          if (_param->_have_port_depth)
1194            {
1195          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
1196                              dest,"out_DEPTH_"+toString(i)+"_MIN");
1197          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
1198                              dest,"out_DEPTH_"+toString(i)+"_MAX");
1199            }
1200          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_FULL",
1201                              dest,"out_DEPTH_"+toString(i)+"_FULL");
1202        }
1203     
1204      //   in_DEPTH_PREDICTION_UNIT_VAL                         - component_prediction_unit
1205      //   in_DEPTH_PREDICTION_UNIT_CURRENT                     - component_prediction_unit
1206      //   in_DEPTH_PREDICTION_UNIT_MIN                         - component_prediction_unit
1207      //   in_DEPTH_PREDICTION_UNIT_MAX                         - component_prediction_unit
1208      //   in_DEPTH_PREDICTION_UNIT_FULL                        - component_prediction_unit
1209      //  out_DEPTH_DECOD_UNIT_MIN                              - component_decod_unit
1210      //  out_DEPTH_DECOD_UNIT_MAX                              - component_decod_unit
1211      //  out_DEPTH_DECOD_UNIT_FULL                             - component_decod_unit
1212      //  out_DEPTH_CONTEXT_STATE_MIN                           - component_context_state
1213     
1214      // ~~~~~[ Interface : "context"" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1215      //  out_CONTEXT_DECOD_UNIT_DEPTH_VAL                      - component_decod_unit
1216      //  out_CONTEXT_DECOD_UNIT_DEPTH                          - component_decod_unit
1217    }
1218   
1219    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1220#if DEBUG_Front_end == true
1221    _component->test_map(false);
1222#endif
1223
1224#ifdef POSITION
1225     if (usage_is_set(_usage,USE_POSITION))
1226       _component->generate_file();
1227#endif
1228
1229     log_end(Front_end,FUNCTION);
1230  };
1231
1232}; // end namespace front_end
1233}; // end namespace multi_front_end
1234}; // end namespace core
1235
1236}; // end namespace behavioural
1237}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.