source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_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: 64.0 KB
Line 
1/*
2 * $Id: Front_end_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/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+1);
184    }
185
186    // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
187    {
188      ALLOC1_INTERFACE("spr",IN,EAST,_("Interface with the special registerFile"),_param->_nb_context);
189     
190      ALLOC1_SIGNAL_IN  ( in_SPR_SR_IEE                       ,"SR_IEE"           ,Tcontrol_t           ,1);
191      ALLOC1_SIGNAL_IN  ( in_SPR_SR_EPH                       ,"SR_EPH"           ,Tcontrol_t           ,1);
192    }
193
194    // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195    {
196      ALLOC1_INTERFACE("interrupt",IN,NORTH,_("Interrupt Exception"),_param->_nb_context);
197
198      ALLOC1_SIGNAL_IN  ( in_INTERRUPT_ENABLE                 ,"ENABLE"           ,Tcontrol_t           ,1);
199    }
200
201    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202    std::string name;
203
204    _component_ifetch_unit = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::Ifetch_unit * [_param->_nb_context];
205   
206    for (uint32_t i=0; i<_param->_nb_context; ++i)
207    {
208      name = _name+"_ifetch_unit_"+toString(i);
209      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
210     
211      _component_ifetch_unit [i] = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::Ifetch_unit
212        (name.c_str()
213#ifdef STATISTICS
214         ,param_statistics
215#endif
216         ,_param->_param_ifetch_unit [i]
217         ,_usage);
218     
219      _component->set_component (_component_ifetch_unit [i]->_component
220#ifdef POSITION
221                                 , 50, 50, 10, 10
222#endif
223                                 );
224    }
225
226    {
227      name = _name+"_prediction_unit";
228      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
229     
230      _component_prediction_unit = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::Prediction_unit
231        (name.c_str()
232#ifdef STATISTICS
233         ,param_statistics
234#endif
235         ,_param->_param_prediction_unit
236         ,_usage);
237     
238      _component->set_component (_component_prediction_unit->_component
239#ifdef POSITION
240                                 , 50, 50, 10, 10
241#endif
242                                 );
243    }
244
245    _component_decod_unit = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Decod_unit * [_param->_nb_decod_unit];
246   
247    for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
248    {
249      name = _name+"_decod_unit_"+toString(i);
250      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
251     
252      _component_decod_unit [i] = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Decod_unit
253        (name.c_str()
254#ifdef STATISTICS
255         ,param_statistics
256#endif
257         ,_param->_param_decod_unit [i]
258         ,_usage);
259     
260      _component->set_component (_component_decod_unit [i]->_component
261#ifdef POSITION
262                                 , 50, 50, 10, 10
263#endif
264                                 );
265    }
266
267    {
268      name = _name+"_context_state";
269      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
270     
271      _component_context_state = new morpheo::behavioural::core::multi_front_end::front_end::context_state::Context_State
272        (name.c_str()
273#ifdef STATISTICS
274         ,param_statistics
275#endif
276         ,_param->_param_context_state
277         ,_usage);
278     
279      _component->set_component (_component_context_state->_component
280#ifdef POSITION
281                                 , 50, 50, 10, 10
282#endif
283                                 );
284    }
285
286    {
287      name = _name+"_glue";
288      log_printf(TRACE,Front_end,FUNCTION,_("Create   : %s"),name.c_str());
289     
290      _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::front_end_glue::Front_end_Glue
291        (name.c_str()
292#ifdef STATISTICS
293         ,param_statistics
294#endif
295         ,_param->_param_glue
296         ,_usage);
297     
298      _component->set_component (_component_glue->_component
299#ifdef POSITION
300                                 , 50, 50, 10, 10
301#endif
302                                 );
303    }
304
305   
306    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
307    std::string src,dest;
308
309    // ===================================================================
310    // =====[ ifetch_unit ]===============================================
311    // ===================================================================
312    for (uint32_t i=0; i<_param->_nb_context; ++i)
313    {
314      src = _name+"_ifetch_unit_"+toString(i);
315      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
316           
317      {
318        dest = _name;
319#ifdef POSITION
320        _component->interface_map (src ,"",
321                                   dest,"");
322#endif
323        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
324        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
325      }
326
327      // ~~~~~[ Interface "icache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328      {
329        dest = _name;
330#ifdef POSITION
331        _component->interface_map (src ,"icache_req",
332                                   dest,"icache_req_"+toString(i));
333#endif
334
335        PORT_MAP(_component,src ,"out_ICACHE_REQ_VAL"      ,dest,"out_ICACHE_REQ_"+toString(i)+"_VAL"      );
336        PORT_MAP(_component,src , "in_ICACHE_REQ_ACK"      ,dest, "in_ICACHE_REQ_"+toString(i)+"_ACK"      );
337      //PORT_MAP(_component,src ,"out_ICACHE_REQ_THREAD_ID",dest,"out_ICACHE_REQ_"+toString(i)+"_THREAD_ID");
338        if (_param->_have_port_ifetch_queue_ptr)
339        PORT_MAP(_component,src ,"out_ICACHE_REQ_PACKET_ID",dest,"out_ICACHE_REQ_"+toString(i)+"_PACKET_ID");
340        PORT_MAP(_component,src ,"out_ICACHE_REQ_ADDRESS"  ,dest,"out_ICACHE_REQ_"+toString(i)+"_ADDRESS"  );
341        PORT_MAP(_component,src ,"out_ICACHE_REQ_TYPE"     ,dest,"out_ICACHE_REQ_"+toString(i)+"_TYPE"     );
342      }
343
344      // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
345      {
346        dest = _name;
347#ifdef POSITION
348        _component->interface_map (src ,"icache_rsp",
349                                   dest,"icache_rsp_"+toString(i));
350#endif
351
352        PORT_MAP(_component,src , "in_ICACHE_RSP_VAL"        ,dest, "in_ICACHE_RSP_"+toString(i)+"_VAL"        );
353        PORT_MAP(_component,src ,"out_ICACHE_RSP_ACK"        ,dest,"out_ICACHE_RSP_"+toString(i)+"_ACK"        );
354//      PORT_MAP(_component,src , "in_ICACHE_RSP_THREAD_ID"  ,dest, "in_ICACHE_RSP_"+toString(i)+"_THREAD_ID"  );
355        if (_param->_have_port_ifetch_queue_ptr)
356        PORT_MAP(_component,src , "in_ICACHE_RSP_PACKET_ID"  ,dest, "in_ICACHE_RSP_"+toString(i)+"_PACKET_ID"  );
357        PORT_MAP(_component,src , "in_ICACHE_RSP_ERROR"      ,dest, "in_ICACHE_RSP_"+toString(i)+"_ERROR"      );
358
359        for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; ++j)
360          {
361#ifdef POSITION
362            _component->interface_map (src ,"icache_rsp_"+toString(j),
363                                       dest,"icache_rsp_"+toString(i)+"_"+toString(j));
364#endif
365           
366            PORT_MAP(_component,src , "in_ICACHE_RSP_"+toString(j)+"_INSTRUCTION",dest, "in_ICACHE_RSP_"+toString(i)+"_"+toString(j)+"_INSTRUCTION");
367          }
368      }
369
370      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
371      {
372        dest = _name+"_prediction_unit";
373#ifdef POSITION
374        _component->interface_map (src ,"predict"
375                                   dest,"predict_"+toString(i));
376#endif
377       
378        COMPONENT_MAP(_component,src ,"out_PREDICT_VAL"                        ,dest, "in_PREDICT_"+toString(i)+"_VAL"                        );
379        COMPONENT_MAP(_component,src , "in_PREDICT_ACK"                        ,dest,"out_PREDICT_"+toString(i)+"_ACK"                        );
380        COMPONENT_MAP(_component,src ,"out_PREDICT_PC_PREVIOUS"                ,dest, "in_PREDICT_"+toString(i)+"_PC_PREVIOUS"                );
381        COMPONENT_MAP(_component,src ,"out_PREDICT_PC_CURRENT"                 ,dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT"                 );
382        COMPONENT_MAP(_component,src ,"out_PREDICT_PC_CURRENT_IS_DS_TAKE"      ,dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE"      );
383        COMPONENT_MAP(_component,src , "in_PREDICT_PC_NEXT"                    ,dest,"out_PREDICT_"+toString(i)+"_PC_NEXT"                    );
384        COMPONENT_MAP(_component,src , "in_PREDICT_PC_NEXT_IS_DS_TAKE"         ,dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         );
385        if (_param->_have_port_inst_ifetch_ptr)
386        COMPONENT_MAP(_component,src , "in_PREDICT_INST_IFETCH_PTR"            ,dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            );
387        COMPONENT_MAP(_component,src , "in_PREDICT_BRANCH_STATE"               ,dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
388        if (_param->_have_port_depth)
389        COMPONENT_MAP(_component,src , "in_PREDICT_BRANCH_UPDATE_PREDICTION_ID",dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
390       
391        for (uint32_t j=0; j<_param->_nb_inst_fetch[i]; ++j)
392          {
393#ifdef POSITION
394            _component->interface_map (src ,"predict_"+toString(j)
395                                       dest,"predict_"+toString(i)+"_"+toString(j));
396#endif
397           
398            COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_INSTRUCTION_ENABLE",
399                                     dest,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE");
400          }
401      }
402
403      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404      {
405        uint32_t num_decod_unit = _param->_link_context_to_decod_unit[i];
406        uint32_t num_context;
407
408        for (num_context=0; num_context<_param->_decod_unit_nb_context[num_decod_unit]; num_context ++)
409          if (_param->_translate_context_id_from_decod_unit [num_decod_unit][num_context] == i)
410            break;
411
412        dest = _name+"_decod_unit_"+toString(num_decod_unit);
413#ifdef POSITION
414        _component->interface_map (src ,"decod"
415                                   dest,"ifetch_"+toString(num_context));
416#endif
417       
418        ////out_DECOD_CONTEXT_ID
419
420        COMPONENT_MAP(_component,src ,"out_DECOD_ADDRESS"                    ,dest, "in_IFETCH_"+toString(num_context)+"_ADDRESS"                    );
421        if (_param->_have_port_inst_ifetch_ptr)
422        COMPONENT_MAP(_component,src ,"out_DECOD_INST_IFETCH_PTR"            ,dest, "in_IFETCH_"+toString(num_context)+"_INST_IFETCH_PTR"            );
423        COMPONENT_MAP(_component,src ,"out_DECOD_BRANCH_STATE"               ,dest, "in_IFETCH_"+toString(num_context)+"_BRANCH_STATE"               );
424        if (_param->_have_port_depth)
425        COMPONENT_MAP(_component,src ,"out_DECOD_BRANCH_UPDATE_PREDICTION_ID",dest, "in_IFETCH_"+toString(num_context)+"_BRANCH_UPDATE_PREDICTION_ID");
426        COMPONENT_MAP(_component,src ,"out_DECOD_EXCEPTION"                  ,dest, "in_IFETCH_"+toString(num_context)+"_EXCEPTION"                  );
427
428        for (uint32_t j=0; j<_param->_nb_inst_fetch [i];++j)
429          {
430            dest = _name+"_decod_unit_"+toString(num_decod_unit);
431#ifdef POSITION
432            _component->interface_map (src ,"decod_"+toString(j)
433                                       dest,"ifetch_"+toString(num_context)+"_"+toString(j));
434#endif
435       
436            COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(j)+                          "_VAL"        ,
437                                     dest, "in_IFETCH_"+toString(num_context)+"_"+toString(j)+"_VAL"        );
438            COMPONENT_MAP(_component,src , "in_DECOD_" +toString(j)+                          "_ACK"        ,
439                                     dest,"out_IFETCH_"+toString(num_context)+"_"+toString(j)+"_ACK"        );
440            COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(j)+                          "_INSTRUCTION",
441                                     dest, "in_IFETCH_"+toString(num_context)+"_"+toString(j)+"_INSTRUCTION");
442          }
443      }
444
445      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
446      {
447        dest = _name+"_glue";
448#ifdef POSITION
449        _component->interface_map (src ,"event",
450                                   dest,"event_"+toString(i));
451#endif
452
453        COMPONENT_MAP(_component,src , "in_EVENT_VAL"             ,
454                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_VAL"             );
455        COMPONENT_MAP(_component,src ,"out_EVENT_ACK"             ,
456                                 dest, "in_EVENT_"+toString(i)+"_IFETCH_UNIT_ACK"             );
457        COMPONENT_MAP(_component,src , "in_EVENT_ADDRESS"         ,
458                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_ADDRESS"         );
459        COMPONENT_MAP(_component,src , "in_EVENT_ADDRESS_NEXT"    ,
460                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_ADDRESS_NEXT"    );
461        COMPONENT_MAP(_component,src , "in_EVENT_ADDRESS_NEXT_VAL",
462                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_ADDRESS_NEXT_VAL");
463        COMPONENT_MAP(_component,src , "in_EVENT_IS_DS_TAKE"      ,
464                                 dest,"out_EVENT_"+toString(i)+"_IFETCH_UNIT_IS_DS_TAKE"      );
465      }
466    }
467
468    // ===================================================================
469    // =====[ prediction_unit ]===========================================
470    // ===================================================================
471    {
472      src = _name+"_prediction_unit";
473      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
474           
475      {
476        dest = _name;
477#ifdef POSITION
478        _component->interface_map (src ,"",
479                                   dest,"");
480#endif
481        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
482        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
483      }
484
485      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
486      //   in_PREDICT_VAL                         - component_ifetch_unit
487      //  out_PREDICT_ACK                         - component_ifetch_unit
488      //   in_PREDICT_PC_PREVIOUS                 - component_ifetch_unit
489      //   in_PREDICT_PC_CURRENT                  - component_ifetch_unit
490      //   in_PREDICT_PC_CURRENT_IS_DS_TAKE       - component_ifetch_unit
491      //  out_PREDICT_PC_NEXT                     - component_ifetch_unit
492      //  out_PREDICT_PC_NEXT_IS_DS_TAKE          - component_ifetch_unit
493      //  out_PREDICT_INSTRUCTION_ENABLE          - component_ifetch_unit
494      //  out_PREDICT_INST_IFETCH_PTR             - component_ifetch_unit
495      //  out_PREDICT_BRANCH_STATE                - component_ifetch_unit
496      //  out_PREDICT_BRANCH_UPDATE_PREDICTION_ID - component_ifetch_unit
497
498      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
499      //   in_DECOD_VAL                           - component_decod_unit
500      //  out_DECOD_ACK                           - component_decod_unit
501      //   in_DECOD_CONTEXT_ID                    - component_decod_unit
502      //   in_DECOD_MATCH_INST_IFETCH_PTR         - component_decod_unit
503      //   in_DECOD_BRANCH_STATE                  - component_decod_unit
504      //   in_DECOD_BRANCH_UPDATE_PREDICTION_ID   - component_decod_unit
505      //   in_DECOD_BRANCH_CONDITION              - component_decod_unit
506      //   in_DECOD_BRANCH_DIRECTION              - component_decod_unit
507      //   in_DECOD_ADDRESS_SRC                   - component_decod_unit
508      //   in_DECOD_ADDRESS_DEST                  - component_decod_unit
509
510      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
511      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
512        {
513          dest = _name+"_glue";
514#ifdef POSITION
515          _component->interface_map (src ,"branch_complete_"+toString(i),
516                                     dest,"branch_complete_"+toString(i));
517#endif
518
519          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+                "_VAL"            ,
520                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTION_UNIT_VAL"            );
521          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+                "_ACK"            ,
522                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTION_UNIT_ACK"            );
523          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+                "_MISS_PREDICTION",
524                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTION_UNIT_MISS_PREDICTION");
525
526          dest = _name;
527#ifdef POSITION
528          _component->interface_map (src ,"branch_complete_"+toString(i),
529                                     dest,"branch_complete_"+toString(i));
530#endif
531
532          if (_param->_have_port_context_id)
533          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID",
534                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID");
535          if (_param->_have_port_depth)
536          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     ,
537                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     );
538          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"   ,
539                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"   );
540          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE",
541                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE");
542
543          dest = _name+"_context_state";
544#ifdef POSITION
545          _component->interface_map (src ,"branch_complete_"+toString(i),
546                                     dest,"branch_complete_"+toString(i));
547#endif
548
549          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE"        ,
550                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_TAKE"        );
551          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC" ,
552                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC" );
553          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST",
554                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST");
555        }
556
557      // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
558      for (uint32_t i=0; i<_param->_nb_context; ++i)
559        {
560          dest = _name+"_context_state";
561#ifdef POSITION
562          _component->interface_map (src ,"branch_event_"+toString(i),
563                                     dest,"branch_event_"+toString(i));
564#endif
565
566          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_VAL"             ,
567                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_VAL"             );
568          COMPONENT_MAP(_component,src , "in_BRANCH_EVENT_"+toString(i)+"_ACK"             ,
569                                   dest,"out_BRANCH_EVENT_"+toString(i)+"_ACK"             );
570//        COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_CONTEXT_ID"      ,
571//                                 dest, "in_BRANCH_EVENT_"+toString(i)+"_CONTEXT_ID"      );
572          if (_param->_have_port_depth)
573          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH"           ,
574                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_DEPTH"           );
575//        COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_MISS_PREDICTION" ,
576//                                 dest, "in_BRANCH_EVENT_"+toString(i)+"_MISS_PREDICTION" );
577          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     ,
578                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     );
579          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL",
580                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL");
581          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    ,
582                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    );
583        }
584
585      // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
586      for (uint32_t i=0; i<_param->_nb_context; ++i)
587        {
588          dest = _name+"_glue";
589#ifdef POSITION
590          _component->interface_map (src ,"event_"+toString(i),
591                                     dest,"event_"+toString(i));
592#endif
593          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_VAL"  ,
594                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_VAL"  );
595          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+                "_ACK"  ,
596                                   dest, "in_EVENT_"+toString(i)+"_PREDICTION_UNIT_ACK"  );
597          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_TYPE" ,
598                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_TYPE" );
599          if (_param->_have_port_depth)
600          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_DEPTH",
601                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_DEPTH");
602        }
603
604      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
605      for (uint32_t i=0; i<_param->_nb_context; ++i)
606        {
607          dest = _name+"_glue";
608#ifdef POSITION
609          _component->interface_map (src ,"depth_"+toString(i),
610                                     dest,"depth_"+toString(i));
611#endif
612
613          if (_param->_have_port_depth)
614            {
615          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_CURRENT",
616                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_CURRENT");
617          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MIN"    ,
618                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MIN"    );
619            }
620          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MAX"    ,
621                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MAX"    );
622        }
623    }
624
625    // ===================================================================
626    // =====[ decod_unit ]================================================
627    // ===================================================================
628    {
629      uint32_t x=0;
630    for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
631    {
632      src = _name+"_decod_unit_"+toString(i);
633      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
634           
635      {
636        dest = _name;
637#ifdef POSITION
638        _component->interface_map (src ,"",
639                                   dest,"");
640#endif
641        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
642        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
643      }
644
645      // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
646      //   in_IFETCH_VAL                         - component_ifetch_unit
647      //  out_IFETCH_ACK                         - component_ifetch_unit
648      //   in_IFETCH_INSTRUCTION                 - component_ifetch_unit
649      //   in_IFETCH_CONTEXT_ID                  - component_ifetch_unit
650      //   in_IFETCH_ADDRESS                     - component_ifetch_unit
651      //// in_IFETCH_ADDRESS_NEXT                - component_ifetch_unit
652      //   in_IFETCH_INST_IFETCH_PTR             - component_ifetch_unit
653      //   in_IFETCH_BRANCH_STATE                - component_ifetch_unit
654      //   in_IFETCH_BRANCH_UPDATE_PREDICTION_ID - component_ifetch_unit
655      //   in_IFETCH_EXCEPTION                   - component_ifetch_unit
656
657      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
658        {
659          dest = _name+"_glue";
660#ifdef POSITION
661          _component->interface_map (src ,"ifetch_"+toString(j),
662                                     dest,"ifetch_"+toString(i)+"_"+toString(j));
663#endif
664     
665          if (_param->_have_port_context_id)
666          COMPONENT_MAP(_component,src , "in_IFETCH_"+toString(j)                           +"_CONTEXT_ID",
667                                   dest,"out_IFETCH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_CONTEXT_ID");
668        }
669
670      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
671      for (uint32_t j=0; j<_param->_nb_inst_decod [i]; ++j)
672        {
673          dest = _name;
674#ifdef POSITION
675          _component->interface_map (src ,"decod_"+toString(j),
676                                     dest,"decod_"+toString(x));
677#endif
678
679         
680          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_VAL"          ,
681                              dest,"out_DECOD_"+toString(x)+"_VAL"          );
682          PORT_MAP(_component,src , "in_DECOD_"+toString(j)+"_ACK"          ,
683                              dest, "in_DECOD_"+toString(x)+"_ACK"          );
684          if (_param->_have_port_depth)
685          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_DEPTH"        ,
686                              dest,"out_DECOD_"+toString(x)+"_DEPTH"        );
687          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_TYPE"         ,
688                              dest,"out_DECOD_"+toString(x)+"_TYPE"         );
689          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_OPERATION"    ,
690                              dest,"out_DECOD_"+toString(x)+"_OPERATION"    );
691          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NO_EXECUTE"   ,
692                              dest,"out_DECOD_"+toString(x)+"_NO_EXECUTE"   );
693          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IS_DELAY_SLOT",
694                              dest,"out_DECOD_"+toString(x)+"_IS_DELAY_SLOT");
695          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_ADDRESS"      ,
696                              dest,"out_DECOD_"+toString(x)+"_ADDRESS"      );
697          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_HAS_IMMEDIAT" ,
698                              dest,"out_DECOD_"+toString(x)+"_HAS_IMMEDIAT" );
699          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IMMEDIAT"     ,
700                              dest,"out_DECOD_"+toString(x)+"_IMMEDIAT"     );
701          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RA"      ,
702                              dest,"out_DECOD_"+toString(x)+"_READ_RA"      );
703          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RA"   ,
704                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RA"   );
705          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RB"      ,
706                              dest,"out_DECOD_"+toString(x)+"_READ_RB"      );
707          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RB"   ,
708                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RB"   );
709          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RC"      ,
710                              dest,"out_DECOD_"+toString(x)+"_READ_RC"      );
711          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RC"   ,
712                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RC"   );
713          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_WRITE_RD"     ,
714                              dest,"out_DECOD_"+toString(x)+"_WRITE_RD"     );
715          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RD"   ,
716                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RD"   );
717          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_WRITE_RE"     ,
718                              dest,"out_DECOD_"+toString(x)+"_WRITE_RE"     );
719          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RE"   ,
720                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RE"   );
721          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_EXCEPTION_USE",
722                              dest,"out_DECOD_"+toString(x)+"_EXCEPTION_USE");
723          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_EXCEPTION"    ,
724                              dest,"out_DECOD_"+toString(x)+"_EXCEPTION"    );
725
726          dest = _name+"_glue";
727#ifdef POSITION
728          _component->interface_map (src ,"decod_"+toString(j),
729                                     dest,"decod_"+toString(i)+"_"+toString(j));
730#endif
731
732          if (_param->_have_port_context_id)
733          COMPONENT_MAP(_component,src ,"out_DECOD_"+toString(j)+                           "_CONTEXT_ID"   ,
734                                   dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_CONTEXT_ID"   );
735
736          x++;
737        }
738     
739      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
740      for (uint32_t j=0; j<_param->_nb_inst_decod[i]; ++j)
741        {
742          dest = _name+"_prediction_unit";
743#ifdef POSITION
744          _component->interface_map (src ,"predict_"+toString(j),
745                                     dest,"decod_"+toString(i)+"_"+toString(j));
746#endif
747
748          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_VAL"                        ,
749                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_VAL"                        );
750          COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_ACK"                        ,
751                                   dest,"out_DECOD_"  +toString(i)+"_"+toString(j)+"_ACK"                        );
752          if (_param->_have_port_context_id)
753          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_CONTEXT_ID"                 ,
754                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 );
755          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_MATCH_INST_IFETCH_PTR"      ,
756                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      );
757          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_STATE"               ,
758                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
759          if (_param->_have_port_depth)
760          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_UPDATE_PREDICTION_ID",
761                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
762          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_CONDITION"           ,
763                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           );
764          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_DIRECTION"           ,
765                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           );
766//        COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_STACK_WRITE"         ,
767//                                 dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_STACK_WRITE"         );
768          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_ADDRESS_SRC"                ,
769                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                );
770          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_ADDRESS_DEST"               ,
771                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               );
772//        COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_CAN_CONTINUE"               ,
773//                                 dest,"out_DECOD_"  +toString(i)+"_"+toString(j)+"_CAN_CONTINUE"               );
774
775        }
776
777      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
778      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
779        {
780 //           uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
781
782          dest = _name+"_glue";
783#ifdef POSITION
784          _component->interface_map (src ,"depth_"+toString(j),
785                                     dest,"depth_"+toString(j));
786#endif
787
788          if (_param->_have_port_depth)
789          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MIN",
790                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MIN");
791          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MAX",
792                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MAX");
793        }
794
795      // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
796      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
797        {
798          uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
799
800          dest = _name+"_context_state";
801#ifdef POSITION
802          _component->interface_map (src ,"nb_inst_"+toString(j),
803                                     dest,"nb_inst_"+toString(y));
804#endif
805
806          COMPONENT_MAP(_component,src ,"out_NB_INST_"+toString(j)+"_DECOD_ALL",
807                                   dest, "in_NB_INST_"+toString(y)+"_DECOD_ALL");
808        }
809
810      // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
811      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
812        {
813          uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
814         
815          dest = _name+"_context_state";
816#ifdef POSITION
817          _component->interface_map (src ,"context_"+toString(j),
818                                     dest,"context_"+toString(y));
819#endif
820
821          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+"_DECOD_ENABLE",
822                                   dest,"out_CONTEXT_"+toString(y)+"_DECOD_ENABLE");
823
824          dest = _name+"_glue";
825#ifdef POSITION
826          _component->interface_map (src ,"context_"+toString(j),
827                                     dest,"context_"+toString(i)+"_"+toString(j));
828#endif
829
830          if (_param->_have_port_depth)
831          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+                           "_DEPTH",
832                                   dest,"out_CONTEXT_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_DEPTH");
833        }
834
835                                                                                     
836      // ~~~~~[ Interface : "context_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
837      {
838        dest = _name+"_context_state";
839#ifdef POSITION
840        _component->interface_map (src ,"context_event",
841                                   dest,"decod_event_"+toString(i));
842#endif
843     
844        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_VAL"          ,dest, "in_DECOD_EVENT_"+toString(i)+"_VAL"          );
845        COMPONENT_MAP(_component,src , "in_CONTEXT_EVENT_ACK"          ,dest,"out_DECOD_EVENT_"+toString(i)+"_ACK"          );
846        if (_param->_have_port_context_id)
847        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_CONTEXT_ID"   ,dest, "in_DECOD_EVENT_"+toString(i)+"_CONTEXT_ID"   );
848        if (_param->_have_port_depth)
849        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_DEPTH"        ,dest, "in_DECOD_EVENT_"+toString(i)+"_DEPTH"        );
850        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_TYPE"         ,dest, "in_DECOD_EVENT_"+toString(i)+"_TYPE"         );
851        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_IS_DELAY_SLOT",dest, "in_DECOD_EVENT_"+toString(i)+"_IS_DELAY_SLOT");
852        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS"      ,dest, "in_DECOD_EVENT_"+toString(i)+"_ADDRESS"      );
853        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS_EPCR" ,dest, "in_DECOD_EVENT_"+toString(i)+"_ADDRESS_EPCR" );
854      }
855    }
856    }
857
858    // ===================================================================
859    // =====[ context_state ]=============================================
860    // ===================================================================
861    {
862      src = _name+"_context_state";
863      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
864           
865      {
866        dest = _name;
867#ifdef POSITION
868        _component->interface_map (src ,"",
869                                   dest,"");
870#endif
871        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
872        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
873      }
874
875    // ~~~~~[ Interface : "decod_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
876      //   in_DECOD_EVENT_VAL                    - component_decod_unit
877      //  out_DECOD_EVENT_ACK                    - component_decod_unit
878      //   in_DECOD_EVENT_CONTEXT_ID             - component_decod_unit
879      //   in_DECOD_EVENT_DEPTH                  - component_decod_unit
880      //   in_DECOD_EVENT_TYPE                   - component_decod_unit
881      //   in_DECOD_EVENT_IS_DELAY_SLOT          - component_decod_unit
882      //   in_DECOD_EVENT_ADDRESS                - component_decod_unit
883      //   in_DECOD_EVENT_ADDRESS_EPCR           - component_decod_unit
884
885      // ~~~~~[ Interface : "commit_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
886      {
887        dest = _name;
888#ifdef POSITION
889        _component->interface_map (src ,"commit_event",
890                                   dest,"commit_event");
891#endif
892       
893        PORT_MAP(_component,src , "in_COMMIT_EVENT_VAL"             ,
894                            dest, "in_COMMIT_EVENT_VAL"             );
895        PORT_MAP(_component,src ,"out_COMMIT_EVENT_ACK"             ,
896                            dest,"out_COMMIT_EVENT_ACK"             );
897        if (_param->_have_port_context_id)
898        PORT_MAP(_component,src , "in_COMMIT_EVENT_CONTEXT_ID"      ,
899                            dest, "in_COMMIT_EVENT_CONTEXT_ID"      );
900        if (_param->_have_port_depth)
901        PORT_MAP(_component,src , "in_COMMIT_EVENT_DEPTH"           ,
902                            dest, "in_COMMIT_EVENT_DEPTH"           );
903        PORT_MAP(_component,src , "in_COMMIT_EVENT_TYPE"            ,
904                            dest, "in_COMMIT_EVENT_TYPE"            );
905        PORT_MAP(_component,src , "in_COMMIT_EVENT_IS_DELAY_SLOT"   ,
906                            dest, "in_COMMIT_EVENT_IS_DELAY_SLOT"   );
907        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS"         ,
908                            dest, "in_COMMIT_EVENT_ADDRESS"         );
909        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EPCR"    ,
910                            dest, "in_COMMIT_EVENT_ADDRESS_EPCR"    );
911        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EEAR_VAL",
912                            dest, "in_COMMIT_EVENT_ADDRESS_EEAR_VAL");
913        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EEAR"    ,
914                            dest, "in_COMMIT_EVENT_ADDRESS_EEAR"    );
915      }
916
917      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
918      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
919        {
920          dest = _name+"_glue";
921#ifdef POSITION
922          _component->interface_map (src ,"branch_complete_"+toString(i),
923                                     dest,"branch_complete_"+toString(i));
924#endif
925
926          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+              "_VAL"            ,
927                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_VAL"            );
928          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+              "_ACK"            ,
929                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_ACK"            );
930          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+              "_MISS_PREDICTION",
931                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_MISS_PREDICTION");
932
933          dest = _name;
934#ifdef POSITION
935          _component->interface_map (src ,"branch_complete_"+toString(i),
936                                     dest,"branch_complete_"+toString(i));
937#endif
938
939          if (_param->_have_port_context_id)
940          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID",
941                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID");
942          if (_param->_have_port_depth)
943          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     ,
944                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     );
945
946          //   in_BRANCH_COMPLETE_TAKE               - component_prediction_unit
947          //   in_BRANCH_COMPLETE_ADDRESS_SRC        - component_prediction_unit
948          //   in_BRANCH_COMPLETE_ADDRESS_DEST       - component_prediction_unit
949      }
950
951      // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
952      //   in_NB_INST_DECOD_ALL                  - component_decod_unit
953
954      for (uint32_t i=0; i<_param->_nb_context; ++i)
955        {
956          dest = _name;
957#ifdef POSITION
958          _component->interface_map (src ,"nb_inst",
959                                     dest,"nb_inst");
960#endif
961         
962          PORT_MAP(_component,src , "in_NB_INST_"+toString(i)+"_COMMIT_ALL",
963                              dest, "in_NB_INST_"+toString(i)+"_COMMIT_ALL");
964          PORT_MAP(_component,src , "in_NB_INST_"+toString(i)+"_COMMIT_MEM",
965                              dest, "in_NB_INST_"+toString(i)+"_COMMIT_MEM");
966      }
967
968      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
969      for (uint32_t i=0; i<_param->_nb_context; ++i)
970        {
971          dest = _name+"_glue";
972#ifdef POSITION
973          _component->interface_map (src ,"event_"+toString(i),
974                                     dest,"event_"+toString(i));
975#endif
976
977          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_VAL"    ,
978                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_VAL"    );
979          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+              "_ACK"    ,
980                                   dest,"out_EVENT_"+toString(i)+"_CONTEXT_STATE_ACK"    );
981          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS",
982                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS");
983          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS_NEXT"    ,
984                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS_NEXT"    ); 
985          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS_NEXT_VAL",
986                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS_NEXT_VAL");
987          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_IS_DS_TAKE"      ,
988                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_IS_DS_TAKE"      );
989          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_TYPE"            ,
990                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_TYPE"            );
991          if (_param->_have_port_depth)
992          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_DEPTH"           ,
993                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_DEPTH"           );
994        }
995
996      // ~~~~~[ Interface "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
997      for (uint32_t i=0; i<_param->_nb_context; ++i)
998        {
999          dest = _name;
1000#ifdef POSITION
1001          _component->interface_map (src ,"spr_event_"+toString(i),
1002                                     dest,"spr_event_"+toString(i));
1003#endif
1004
1005          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_VAL"      ,
1006                              dest,"out_SPR_EVENT_"+toString(i)+"_VAL"      );
1007          PORT_MAP(_component,src , "in_SPR_EVENT_"+toString(i)+"_ACK"      ,
1008                              dest, "in_SPR_EVENT_"+toString(i)+"_ACK"      );
1009          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EPCR"     ,
1010                              dest,"out_SPR_EVENT_"+toString(i)+"_EPCR"     );
1011          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EEAR"     ,
1012                              dest,"out_SPR_EVENT_"+toString(i)+"_EEAR"     );
1013          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EEAR_WEN" ,
1014                              dest,"out_SPR_EVENT_"+toString(i)+"_EEAR_WEN" );
1015          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_SR_DSX"   ,
1016                              dest,"out_SPR_EVENT_"+toString(i)+"_SR_DSX"   );
1017          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_SR_TO_ESR",
1018                              dest,"out_SPR_EVENT_"+toString(i)+"_SR_TO_ESR");
1019        }
1020
1021      // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1022      //  out_CONTEXT_DECOD_ENABLE               - component_decod_unit
1023
1024      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1025      for (uint32_t i=0; i<_param->_nb_context; ++i)
1026        {
1027          dest = _name+"_glue";
1028#ifdef POSITION
1029          _component->interface_map (src ,"depth_"+toString(i),
1030                                     dest,"depth_"+toString(i));
1031#endif
1032
1033          if (_param->_have_port_depth)
1034          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(i)+              "_MIN",
1035                                   dest,"out_DEPTH_"+toString(i)+"_CONTEXT_STATE_MIN");
1036        }
1037
1038      // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1039      for (uint32_t i=0; i<_param->_nb_context; ++i)
1040        {
1041          dest = _name;
1042#ifdef POSITION
1043          _component->interface_map (src ,"spr_"+toString(i),
1044                                     dest,"spr_"+toString(i));
1045#endif
1046         
1047          PORT_MAP(_component,src , "in_SPR_"+toString(i)+"_SR_IEE",
1048                              dest, "in_SPR_"+toString(i)+"_SR_IEE");
1049          PORT_MAP(_component,src , "in_SPR_"+toString(i)+"_SR_EPH",
1050                              dest, "in_SPR_"+toString(i)+"_SR_EPH");
1051        }
1052
1053      // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1054      for (uint32_t i=0; i<_param->_nb_context; ++i)
1055        {
1056          dest = _name;
1057#ifdef POSITION
1058          _component->interface_map (src ,"interrupt_"+toString(i),
1059                                     dest,"interrupt_"+toString(i));
1060#endif
1061         
1062          PORT_MAP(_component,src , "in_INTERRUPT_"+toString(i)+"_ENABLE",
1063                              dest, "in_INTERRUPT_"+toString(i)+"_ENABLE");
1064        }
1065
1066    }
1067   
1068    // ===================================================================
1069    // =====[ glue ]======================================================
1070    // ===================================================================
1071    {
1072      src = _name+"_glue";
1073      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
1074           
1075      {
1076        dest = _name;
1077#ifdef POSITION
1078        _component->interface_map (src ,"",
1079                                   dest,"");
1080#endif
1081        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
1082        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
1083      }
1084     
1085      // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1086      // out_IFETCH_DECOD_UNIT_CONTEXT_ID                       - component_decod_unit
1087     
1088      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089      uint32_t x=0;
1090      for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
1091        for (uint32_t j=0; j<_param->_nb_inst_decod[i];++j)
1092          {
1093            dest = _name;
1094#ifdef POSITION
1095            _component->interface_map (src ,"decod_"+toString(i)+"_"+toString(j),
1096                                       dest,"decod_"+toString(x));
1097#endif
1098           
1099            if (_param->_have_port_context_id)
1100            PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID",
1101                                dest,"out_DECOD_"+toString(x)+                "_CONTEXT_ID");
1102            x++;
1103          }
1104      //  in_DECOD_DECOD_UNIT_CONTEXT_ID                        - component_decod_unit
1105   
1106      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
1108        {
1109          dest = _name;
1110#ifdef POSITION
1111          _component->interface_map (src ,"branch_complete_"+toString(i),
1112                                     dest,"branch_complete_"+toString(i));
1113#endif
1114
1115          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            ,
1116                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            );
1117          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            ,
1118                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            );
1119          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION",
1120                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION");
1121        }
1122     
1123      //  out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL               - component_prediction_unit
1124      //   in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK               - component_prediction_unit
1125      //   in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION   - component_prediction_unit
1126      //  out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                 - component_context_state
1127      //   in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                 - component_context_state
1128      //  out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION     - component_context_state
1129
1130      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1131      for (uint32_t i=0; i<_param->_nb_context; ++i)
1132        {
1133          dest = _name;
1134#ifdef POSITION
1135          _component->interface_map (src ,"event_"+toString(i),
1136                                     dest,"event_"+toString(i));
1137#endif
1138
1139          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_VAL"             ,
1140                              dest,"out_EVENT_"+toString(i)+"_VAL"             );
1141          PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_ACK"             ,
1142                              dest, "in_EVENT_"+toString(i)+"_ACK"             );
1143          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS"         ,
1144                              dest,"out_EVENT_"+toString(i)+"_ADDRESS"         );
1145          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT"    ,
1146                              dest,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT"    );
1147          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT_VAL",
1148                              dest,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT_VAL");
1149          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_IS_DS_TAKE"      ,
1150                              dest,"out_EVENT_"+toString(i)+"_IS_DS_TAKE"      );
1151        }
1152
1153      //  out_EVENT_IFETCH_UNIT_VAL                             - component_ifetch_unit
1154      //   in_EVENT_IFETCH_UNIT_ACK                             - component_ifetch_unit
1155      //  out_EVENT_IFETCH_UNIT_ADDRESS                         - component_ifetch_unit
1156      //  out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                    - component_ifetch_unit
1157      //  out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL                - component_ifetch_unit
1158      //   in_EVENT_IFETCH_UNIT_IS_DS_TAKE                      - component_ifetch_unit
1159      //  out_EVENT_PREDICTION_UNIT_VAL                         - component_prediction_unit
1160      //   in_EVENT_PREDICTION_UNIT_ACK                         - component_prediction_unit
1161      //  out_EVENT_PREDICTION_UNIT_TYPE                        - component_prediction_unit
1162      //  out_EVENT_PREDICTION_UNIT_DEPTH                       - component_prediction_unit
1163      //   in_EVENT_CONTEXT_STATE_VAL                           - component_context_state
1164      //  out_EVENT_CONTEXT_STATE_ACK                           - component_context_state
1165      //   in_EVENT_CONTEXT_STATE_ADDRESS                       - component_context_state
1166      //   in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                  - component_context_state
1167      //   in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL              - component_context_state
1168      //   in_EVENT_CONTEXT_STATE_IS_DS_TAKE                    - component_context_state
1169      //   in_EVENT_CONTEXT_STATE_TYPE                          - component_context_state
1170      //   in_EVENT_CONTEXT_STATE_DEPTH                         - component_context_state
1171
1172      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
1173      for (uint32_t i=0; i<_param->_nb_context; ++i)
1174        {
1175          dest = _name;
1176#ifdef POSITION
1177          _component->interface_map (src ,"depth_"+toString(i),
1178                                     dest,"depth_"+toString(i));
1179#endif
1180
1181          if (_param->_have_port_depth)
1182          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
1183                              dest,"out_DEPTH_"+toString(i)+"_MIN");
1184          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
1185                              dest,"out_DEPTH_"+toString(i)+"_MAX");
1186        }
1187     
1188      //   in_DEPTH_PREDICTION_UNIT_CURRENT                     - component_prediction_unit
1189      //   in_DEPTH_PREDICTION_UNIT_MIN                         - component_prediction_unit
1190      //   in_DEPTH_PREDICTION_UNIT_MAX                         - component_prediction_unit
1191      //  out_DEPTH_DECOD_UNIT_MIN                              - component_decod_unit
1192      //  out_DEPTH_DECOD_UNIT_MAX                              - component_decod_unit
1193      //  out_DEPTH_CONTEXT_STATE_MIN                           - component_context_state
1194     
1195      // ~~~~~[ Interface : "context"" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1196      //  out_CONTEXT_DECOD_UNIT_DEPTH                          - component_decod_unit
1197    }
1198   
1199    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1200#if DEBUG_Front_end == true
1201    _component->test_map(false);
1202#endif
1203
1204#ifdef POSITION
1205     if (usage_is_set(_usage,USE_POSITION))
1206       _component->generate_file();
1207#endif
1208
1209     log_end(Front_end,FUNCTION);
1210  };
1211
1212}; // end namespace front_end
1213}; // end namespace multi_front_end
1214}; // end namespace core
1215
1216}; // end namespace behavioural
1217}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.