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

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

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

  • Property svn:keywords set to Id
File size: 63.9 KB
Line 
1/*
2 * $Id: Front_end_allocation.cpp 97 2008-12-19 15:34:00Z 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_FLAG             ,"FLAG"             ,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)+"_FLAG"      ,
541                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_FLAG"      );
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//        COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH"           ,
573//                                 dest, "in_BRANCH_EVENT_"+toString(i)+"_DEPTH"           );
574//        COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_MISS_PREDICTION" ,
575//                                 dest, "in_BRANCH_EVENT_"+toString(i)+"_MISS_PREDICTION" );
576          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     ,
577                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     );
578          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL",
579                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL");
580          COMPONENT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    ,
581                                   dest, "in_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    );
582        }
583
584      // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
585      for (uint32_t i=0; i<_param->_nb_context; ++i)
586        {
587          dest = _name+"_glue";
588#ifdef POSITION
589          _component->interface_map (src ,"event_"+toString(i),
590                                     dest,"event_"+toString(i));
591#endif
592          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_VAL"  ,
593                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_VAL"  );
594          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+                "_ACK"  ,
595                                   dest, "in_EVENT_"+toString(i)+"_PREDICTION_UNIT_ACK"  );
596          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_TYPE" ,
597                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_TYPE" );
598          if (_param->_have_port_depth)
599          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+                "_DEPTH",
600                                   dest,"out_EVENT_"+toString(i)+"_PREDICTION_UNIT_DEPTH");
601        }
602
603      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
604      for (uint32_t i=0; i<_param->_nb_context; ++i)
605        {
606          dest = _name+"_glue";
607#ifdef POSITION
608          _component->interface_map (src ,"depth_"+toString(i),
609                                     dest,"depth_"+toString(i));
610#endif
611
612          if (_param->_have_port_depth)
613            {
614          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_CURRENT",
615                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_CURRENT");
616          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MIN"    ,
617                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MIN"    );
618            }
619          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MAX"    ,
620                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MAX"    );
621        }
622    }
623
624    // ===================================================================
625    // =====[ decod_unit ]================================================
626    // ===================================================================
627    {
628      uint32_t x=0;
629    for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
630    {
631      src = _name+"_decod_unit_"+toString(i);
632      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
633           
634      {
635        dest = _name;
636#ifdef POSITION
637        _component->interface_map (src ,"",
638                                   dest,"");
639#endif
640        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
641        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
642      }
643
644      // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
645      //   in_IFETCH_VAL                         - component_ifetch_unit
646      //  out_IFETCH_ACK                         - component_ifetch_unit
647      //   in_IFETCH_INSTRUCTION                 - component_ifetch_unit
648      //   in_IFETCH_CONTEXT_ID                  - component_ifetch_unit
649      //   in_IFETCH_ADDRESS                     - component_ifetch_unit
650      //// in_IFETCH_ADDRESS_NEXT                - component_ifetch_unit
651      //   in_IFETCH_INST_IFETCH_PTR             - component_ifetch_unit
652      //   in_IFETCH_BRANCH_STATE                - component_ifetch_unit
653      //   in_IFETCH_BRANCH_UPDATE_PREDICTION_ID - component_ifetch_unit
654      //   in_IFETCH_EXCEPTION                   - component_ifetch_unit
655
656      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
657        {
658          dest = _name+"_glue";
659#ifdef POSITION
660          _component->interface_map (src ,"ifetch_"+toString(j),
661                                     dest,"ifetch_"+toString(i)+"_"+toString(j));
662#endif
663     
664          if (_param->_have_port_context_id)
665          COMPONENT_MAP(_component,src , "in_IFETCH_"+toString(j)                           +"_CONTEXT_ID",
666                                   dest,"out_IFETCH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_CONTEXT_ID");
667        }
668
669      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
670      for (uint32_t j=0; j<_param->_nb_inst_decod [i]; ++j)
671        {
672          dest = _name;
673#ifdef POSITION
674          _component->interface_map (src ,"decod_"+toString(j),
675                                     dest,"decod_"+toString(x));
676#endif
677
678         
679          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_VAL"          ,
680                              dest,"out_DECOD_"+toString(x)+"_VAL"          );
681          PORT_MAP(_component,src , "in_DECOD_"+toString(j)+"_ACK"          ,
682                              dest, "in_DECOD_"+toString(x)+"_ACK"          );
683          if (_param->_have_port_depth)
684          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_DEPTH"        ,
685                              dest,"out_DECOD_"+toString(x)+"_DEPTH"        );
686          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_TYPE"         ,
687                              dest,"out_DECOD_"+toString(x)+"_TYPE"         );
688          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_OPERATION"    ,
689                              dest,"out_DECOD_"+toString(x)+"_OPERATION"    );
690          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NO_EXECUTE"   ,
691                              dest,"out_DECOD_"+toString(x)+"_NO_EXECUTE"   );
692          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IS_DELAY_SLOT",
693                              dest,"out_DECOD_"+toString(x)+"_IS_DELAY_SLOT");
694          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_ADDRESS"      ,
695                              dest,"out_DECOD_"+toString(x)+"_ADDRESS"      );
696          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_HAS_IMMEDIAT" ,
697                              dest,"out_DECOD_"+toString(x)+"_HAS_IMMEDIAT" );
698          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IMMEDIAT"     ,
699                              dest,"out_DECOD_"+toString(x)+"_IMMEDIAT"     );
700          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RA"      ,
701                              dest,"out_DECOD_"+toString(x)+"_READ_RA"      );
702          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RA"   ,
703                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RA"   );
704          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RB"      ,
705                              dest,"out_DECOD_"+toString(x)+"_READ_RB"      );
706          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RB"   ,
707                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RB"   );
708          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_READ_RC"      ,
709                              dest,"out_DECOD_"+toString(x)+"_READ_RC"      );
710          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RC"   ,
711                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RC"   );
712          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_WRITE_RD"     ,
713                              dest,"out_DECOD_"+toString(x)+"_WRITE_RD"     );
714          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RD"   ,
715                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RD"   );
716          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_WRITE_RE"     ,
717                              dest,"out_DECOD_"+toString(x)+"_WRITE_RE"     );
718          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NUM_REG_RE"   ,
719                              dest,"out_DECOD_"+toString(x)+"_NUM_REG_RE"   );
720          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_EXCEPTION_USE",
721                              dest,"out_DECOD_"+toString(x)+"_EXCEPTION_USE");
722          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_EXCEPTION"    ,
723                              dest,"out_DECOD_"+toString(x)+"_EXCEPTION"    );
724
725          dest = _name+"_glue";
726#ifdef POSITION
727          _component->interface_map (src ,"decod_"+toString(j),
728                                     dest,"decod_"+toString(i)+"_"+toString(j));
729#endif
730
731          if (_param->_have_port_context_id)
732          COMPONENT_MAP(_component,src ,"out_DECOD_"+toString(j)+                           "_CONTEXT_ID"   ,
733                                   dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_CONTEXT_ID"   );
734
735          x++;
736        }
737     
738      // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
739      for (uint32_t j=0; j<_param->_nb_inst_decod[i]; ++j)
740        {
741          dest = _name+"_prediction_unit";
742#ifdef POSITION
743          _component->interface_map (src ,"predict_"+toString(j),
744                                     dest,"decod_"+toString(i)+"_"+toString(j));
745#endif
746
747          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_VAL"                        ,
748                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_VAL"                        );
749          COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_ACK"                        ,
750                                   dest,"out_DECOD_"  +toString(i)+"_"+toString(j)+"_ACK"                        );
751          if (_param->_have_port_context_id)
752          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_CONTEXT_ID"                 ,
753                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 );
754          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_MATCH_INST_IFETCH_PTR"      ,
755                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      );
756          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_STATE"               ,
757                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
758          if (_param->_have_port_depth)
759          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_UPDATE_PREDICTION_ID",
760                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
761          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_CONDITION"           ,
762                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           );
763          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_DIRECTION"           ,
764                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           );
765//        COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_BRANCH_STACK_WRITE"         ,
766//                                 dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_BRANCH_STACK_WRITE"         );
767          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_ADDRESS_SRC"                ,
768                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                );
769          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(j)+                "_ADDRESS_DEST"               ,
770                                   dest, "in_DECOD_"  +toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               );
771//        COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(j)+                "_CAN_CONTINUE"               ,
772//                                 dest,"out_DECOD_"  +toString(i)+"_"+toString(j)+"_CAN_CONTINUE"               );
773
774        }
775
776      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
777      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
778        {
779 //           uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
780
781          dest = _name+"_glue";
782#ifdef POSITION
783          _component->interface_map (src ,"depth_"+toString(j),
784                                     dest,"depth_"+toString(j));
785#endif
786
787          if (_param->_have_port_depth)
788          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MIN",
789                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MIN");
790          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MAX",
791                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MAX");
792        }
793
794      // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
795      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
796        {
797          uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
798
799          dest = _name+"_context_state";
800#ifdef POSITION
801          _component->interface_map (src ,"nb_inst_"+toString(j),
802                                     dest,"nb_inst_"+toString(y));
803#endif
804
805          COMPONENT_MAP(_component,src ,"out_NB_INST_"+toString(j)+"_DECOD_ALL",
806                                   dest, "in_NB_INST_"+toString(y)+"_DECOD_ALL");
807        }
808
809      // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
810      for (uint32_t j=0; j<_param->_decod_unit_nb_context[i]; ++j)
811        {
812          uint32_t y=(_param->_translate_context_id_from_decod_unit[i])[j];
813         
814          dest = _name+"_context_state";
815#ifdef POSITION
816          _component->interface_map (src ,"context_"+toString(j),
817                                     dest,"context_"+toString(y));
818#endif
819
820          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+"_DECOD_ENABLE",
821                                   dest,"out_CONTEXT_"+toString(y)+"_DECOD_ENABLE");
822
823          dest = _name+"_glue";
824#ifdef POSITION
825          _component->interface_map (src ,"context_"+toString(j),
826                                     dest,"context_"+toString(i)+"_"+toString(j));
827#endif
828
829          if (_param->_have_port_depth)
830          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+                           "_DEPTH",
831                                   dest,"out_CONTEXT_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_DEPTH");
832        }
833
834                                                                                     
835      // ~~~~~[ Interface : "context_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
836      {
837        dest = _name+"_context_state";
838#ifdef POSITION
839        _component->interface_map (src ,"context_event",
840                                   dest,"decod_event_"+toString(i));
841#endif
842     
843        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_VAL"          ,dest, "in_DECOD_EVENT_"+toString(i)+"_VAL"          );
844        COMPONENT_MAP(_component,src , "in_CONTEXT_EVENT_ACK"          ,dest,"out_DECOD_EVENT_"+toString(i)+"_ACK"          );
845        if (_param->_have_port_context_id)
846        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_CONTEXT_ID"   ,dest, "in_DECOD_EVENT_"+toString(i)+"_CONTEXT_ID"   );
847        if (_param->_have_port_depth)
848        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_DEPTH"        ,dest, "in_DECOD_EVENT_"+toString(i)+"_DEPTH"        );
849        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_TYPE"         ,dest, "in_DECOD_EVENT_"+toString(i)+"_TYPE"         );
850        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_IS_DELAY_SLOT",dest, "in_DECOD_EVENT_"+toString(i)+"_IS_DELAY_SLOT");
851        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS"      ,dest, "in_DECOD_EVENT_"+toString(i)+"_ADDRESS"      );
852        COMPONENT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS_EPCR" ,dest, "in_DECOD_EVENT_"+toString(i)+"_ADDRESS_EPCR" );
853      }
854    }
855    }
856
857    // ===================================================================
858    // =====[ context_state ]=============================================
859    // ===================================================================
860    {
861      src = _name+"_context_state";
862      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
863           
864      {
865        dest = _name;
866#ifdef POSITION
867        _component->interface_map (src ,"",
868                                   dest,"");
869#endif
870        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
871        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
872      }
873
874    // ~~~~~[ Interface : "decod_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
875      //   in_DECOD_EVENT_VAL                    - component_decod_unit
876      //  out_DECOD_EVENT_ACK                    - component_decod_unit
877      //   in_DECOD_EVENT_CONTEXT_ID             - component_decod_unit
878      //   in_DECOD_EVENT_DEPTH                  - component_decod_unit
879      //   in_DECOD_EVENT_TYPE                   - component_decod_unit
880      //   in_DECOD_EVENT_IS_DELAY_SLOT          - component_decod_unit
881      //   in_DECOD_EVENT_ADDRESS                - component_decod_unit
882      //   in_DECOD_EVENT_ADDRESS_EPCR           - component_decod_unit
883
884      // ~~~~~[ Interface : "commit_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
885      {
886        dest = _name;
887#ifdef POSITION
888        _component->interface_map (src ,"commit_event",
889                                   dest,"commit_event");
890#endif
891       
892        PORT_MAP(_component,src , "in_COMMIT_EVENT_VAL"             ,
893                            dest, "in_COMMIT_EVENT_VAL"             );
894        PORT_MAP(_component,src ,"out_COMMIT_EVENT_ACK"             ,
895                            dest,"out_COMMIT_EVENT_ACK"             );
896        if (_param->_have_port_context_id)
897        PORT_MAP(_component,src , "in_COMMIT_EVENT_CONTEXT_ID"      ,
898                            dest, "in_COMMIT_EVENT_CONTEXT_ID"      );
899        if (_param->_have_port_depth)
900        PORT_MAP(_component,src , "in_COMMIT_EVENT_DEPTH"           ,
901                            dest, "in_COMMIT_EVENT_DEPTH"           );
902        PORT_MAP(_component,src , "in_COMMIT_EVENT_TYPE"            ,
903                            dest, "in_COMMIT_EVENT_TYPE"            );
904        PORT_MAP(_component,src , "in_COMMIT_EVENT_IS_DELAY_SLOT"   ,
905                            dest, "in_COMMIT_EVENT_IS_DELAY_SLOT"   );
906        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS"         ,
907                            dest, "in_COMMIT_EVENT_ADDRESS"         );
908        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EPCR"    ,
909                            dest, "in_COMMIT_EVENT_ADDRESS_EPCR"    );
910        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EEAR_VAL",
911                            dest, "in_COMMIT_EVENT_ADDRESS_EEAR_VAL");
912        PORT_MAP(_component,src , "in_COMMIT_EVENT_ADDRESS_EEAR"    ,
913                            dest, "in_COMMIT_EVENT_ADDRESS_EEAR"    );
914      }
915
916      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
917      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
918        {
919          dest = _name+"_glue";
920#ifdef POSITION
921          _component->interface_map (src ,"branch_complete_"+toString(i),
922                                     dest,"branch_complete_"+toString(i));
923#endif
924
925          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+              "_VAL"            ,
926                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_VAL"            );
927          COMPONENT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+              "_ACK"            ,
928                                   dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_ACK"            );
929          COMPONENT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+              "_MISS_PREDICTION",
930                                   dest,"out_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_STATE_MISS_PREDICTION");
931
932          dest = _name;
933#ifdef POSITION
934          _component->interface_map (src ,"branch_complete_"+toString(i),
935                                     dest,"branch_complete_"+toString(i));
936#endif
937
938          if (_param->_have_port_context_id)
939          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID",
940                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID");
941          if (_param->_have_port_depth)
942          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     ,
943                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"     );
944
945          //   in_BRANCH_COMPLETE_TAKE               - component_prediction_unit
946          //   in_BRANCH_COMPLETE_ADDRESS_SRC        - component_prediction_unit
947          //   in_BRANCH_COMPLETE_ADDRESS_DEST       - component_prediction_unit
948      }
949
950      // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
951      //   in_NB_INST_DECOD_ALL                  - component_decod_unit
952
953      for (uint32_t i=0; i<_param->_nb_context; ++i)
954        {
955          dest = _name;
956#ifdef POSITION
957          _component->interface_map (src ,"nb_inst",
958                                     dest,"nb_inst");
959#endif
960         
961          PORT_MAP(_component,src , "in_NB_INST_"+toString(i)+"_COMMIT_ALL",
962                              dest, "in_NB_INST_"+toString(i)+"_COMMIT_ALL");
963          PORT_MAP(_component,src , "in_NB_INST_"+toString(i)+"_COMMIT_MEM",
964                              dest, "in_NB_INST_"+toString(i)+"_COMMIT_MEM");
965      }
966
967      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
968      for (uint32_t i=0; i<_param->_nb_context; ++i)
969        {
970          dest = _name+"_glue";
971#ifdef POSITION
972          _component->interface_map (src ,"event_"+toString(i),
973                                     dest,"event_"+toString(i));
974#endif
975
976          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_VAL"    ,
977                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_VAL"    );
978          COMPONENT_MAP(_component,src , "in_EVENT_"+toString(i)+              "_ACK"    ,
979                                   dest,"out_EVENT_"+toString(i)+"_CONTEXT_STATE_ACK"    );
980          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS",
981                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS");
982          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS_NEXT"    ,
983                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS_NEXT"    ); 
984          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_ADDRESS_NEXT_VAL",
985                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_ADDRESS_NEXT_VAL");
986          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_IS_DS_TAKE"      ,
987                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_IS_DS_TAKE"      );
988          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_TYPE"            ,
989                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_TYPE"            );
990          if (_param->_have_port_depth)
991          COMPONENT_MAP(_component,src ,"out_EVENT_"+toString(i)+              "_DEPTH"           ,
992                                   dest, "in_EVENT_"+toString(i)+"_CONTEXT_STATE_DEPTH"           );
993        }
994
995      // ~~~~~[ Interface "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
996      for (uint32_t i=0; i<_param->_nb_context; ++i)
997        {
998          dest = _name;
999#ifdef POSITION
1000          _component->interface_map (src ,"spr_event_"+toString(i),
1001                                     dest,"spr_event_"+toString(i));
1002#endif
1003
1004          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_VAL"      ,
1005                              dest,"out_SPR_EVENT_"+toString(i)+"_VAL"      );
1006          PORT_MAP(_component,src , "in_SPR_EVENT_"+toString(i)+"_ACK"      ,
1007                              dest, "in_SPR_EVENT_"+toString(i)+"_ACK"      );
1008          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EPCR"     ,
1009                              dest,"out_SPR_EVENT_"+toString(i)+"_EPCR"     );
1010          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EEAR"     ,
1011                              dest,"out_SPR_EVENT_"+toString(i)+"_EEAR"     );
1012          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_EEAR_WEN" ,
1013                              dest,"out_SPR_EVENT_"+toString(i)+"_EEAR_WEN" );
1014          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_SR_DSX"   ,
1015                              dest,"out_SPR_EVENT_"+toString(i)+"_SR_DSX"   );
1016          PORT_MAP(_component,src ,"out_SPR_EVENT_"+toString(i)+"_SR_TO_ESR",
1017                              dest,"out_SPR_EVENT_"+toString(i)+"_SR_TO_ESR");
1018        }
1019
1020      // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1021      //  out_CONTEXT_DECOD_ENABLE               - component_decod_unit
1022
1023      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1024      for (uint32_t i=0; i<_param->_nb_context; ++i)
1025        {
1026          dest = _name+"_glue";
1027#ifdef POSITION
1028          _component->interface_map (src ,"depth_"+toString(i),
1029                                     dest,"depth_"+toString(i));
1030#endif
1031
1032          if (_param->_have_port_depth)
1033          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(i)+              "_MIN",
1034                                   dest,"out_DEPTH_"+toString(i)+"_CONTEXT_STATE_MIN");
1035        }
1036
1037      // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1038      for (uint32_t i=0; i<_param->_nb_context; ++i)
1039        {
1040          dest = _name;
1041#ifdef POSITION
1042          _component->interface_map (src ,"spr_"+toString(i),
1043                                     dest,"spr_"+toString(i));
1044#endif
1045         
1046          PORT_MAP(_component,src , "in_SPR_"+toString(i)+"_SR_IEE",
1047                              dest, "in_SPR_"+toString(i)+"_SR_IEE");
1048          PORT_MAP(_component,src , "in_SPR_"+toString(i)+"_SR_EPH",
1049                              dest, "in_SPR_"+toString(i)+"_SR_EPH");
1050        }
1051
1052      // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1053      for (uint32_t i=0; i<_param->_nb_context; ++i)
1054        {
1055          dest = _name;
1056#ifdef POSITION
1057          _component->interface_map (src ,"interrupt_"+toString(i),
1058                                     dest,"interrupt_"+toString(i));
1059#endif
1060         
1061          PORT_MAP(_component,src , "in_INTERRUPT_"+toString(i)+"_ENABLE",
1062                              dest, "in_INTERRUPT_"+toString(i)+"_ENABLE");
1063        }
1064
1065    }
1066   
1067    // ===================================================================
1068    // =====[ glue ]======================================================
1069    // ===================================================================
1070    {
1071      src = _name+"_glue";
1072      log_printf(TRACE,Front_end,FUNCTION,_("Instance : %s"),src.c_str());
1073           
1074      {
1075        dest = _name;
1076#ifdef POSITION
1077        _component->interface_map (src ,"",
1078                                   dest,"");
1079#endif
1080        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
1081        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
1082      }
1083     
1084      // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1085      // out_IFETCH_DECOD_UNIT_CONTEXT_ID                       - component_decod_unit
1086     
1087      // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088      uint32_t x=0;
1089      for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
1090        for (uint32_t j=0; j<_param->_nb_inst_decod[i];++j)
1091          {
1092            dest = _name;
1093#ifdef POSITION
1094            _component->interface_map (src ,"decod_"+toString(i)+"_"+toString(j),
1095                                       dest,"decod_"+toString(x));
1096#endif
1097           
1098            if (_param->_have_port_context_id)
1099            PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID",
1100                                dest,"out_DECOD_"+toString(x)+                "_CONTEXT_ID");
1101            x++;
1102          }
1103      //  in_DECOD_DECOD_UNIT_CONTEXT_ID                        - component_decod_unit
1104   
1105      // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
1107        {
1108          dest = _name;
1109#ifdef POSITION
1110          _component->interface_map (src ,"branch_complete_"+toString(i),
1111                                     dest,"branch_complete_"+toString(i));
1112#endif
1113
1114          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            ,
1115                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            );
1116          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            ,
1117                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            );
1118          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION",
1119                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION");
1120        }
1121     
1122      //  out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL               - component_prediction_unit
1123      //   in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK               - component_prediction_unit
1124      //   in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION   - component_prediction_unit
1125      //  out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                 - component_context_state
1126      //   in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                 - component_context_state
1127      //  out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION     - component_context_state
1128
1129      // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1130      for (uint32_t i=0; i<_param->_nb_context; ++i)
1131        {
1132          dest = _name;
1133#ifdef POSITION
1134          _component->interface_map (src ,"event_"+toString(i),
1135                                     dest,"event_"+toString(i));
1136#endif
1137
1138          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_VAL"             ,
1139                              dest,"out_EVENT_"+toString(i)+"_VAL"             );
1140          PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_ACK"             ,
1141                              dest, "in_EVENT_"+toString(i)+"_ACK"             );
1142          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS"         ,
1143                              dest,"out_EVENT_"+toString(i)+"_ADDRESS"         );
1144          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT"    ,
1145                              dest,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT"    );
1146          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT_VAL",
1147                              dest,"out_EVENT_"+toString(i)+"_ADDRESS_NEXT_VAL");
1148          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_IS_DS_TAKE"      ,
1149                              dest,"out_EVENT_"+toString(i)+"_IS_DS_TAKE"      );
1150        }
1151
1152      //  out_EVENT_IFETCH_UNIT_VAL                             - component_ifetch_unit
1153      //   in_EVENT_IFETCH_UNIT_ACK                             - component_ifetch_unit
1154      //  out_EVENT_IFETCH_UNIT_ADDRESS                         - component_ifetch_unit
1155      //  out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                    - component_ifetch_unit
1156      //  out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL                - component_ifetch_unit
1157      //   in_EVENT_IFETCH_UNIT_IS_DS_TAKE                      - component_ifetch_unit
1158      //  out_EVENT_PREDICTION_UNIT_VAL                         - component_prediction_unit
1159      //   in_EVENT_PREDICTION_UNIT_ACK                         - component_prediction_unit
1160      //  out_EVENT_PREDICTION_UNIT_TYPE                        - component_prediction_unit
1161      //  out_EVENT_PREDICTION_UNIT_DEPTH                       - component_prediction_unit
1162      //   in_EVENT_CONTEXT_STATE_VAL                           - component_context_state
1163      //  out_EVENT_CONTEXT_STATE_ACK                           - component_context_state
1164      //   in_EVENT_CONTEXT_STATE_ADDRESS                       - component_context_state
1165      //   in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                  - component_context_state
1166      //   in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL              - component_context_state
1167      //   in_EVENT_CONTEXT_STATE_IS_DS_TAKE                    - component_context_state
1168      //   in_EVENT_CONTEXT_STATE_TYPE                          - component_context_state
1169      //   in_EVENT_CONTEXT_STATE_DEPTH                         - component_context_state
1170
1171      // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
1172      for (uint32_t i=0; i<_param->_nb_context; ++i)
1173        {
1174          dest = _name;
1175#ifdef POSITION
1176          _component->interface_map (src ,"depth_"+toString(i),
1177                                     dest,"depth_"+toString(i));
1178#endif
1179
1180          if (_param->_have_port_depth)
1181          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
1182                              dest,"out_DEPTH_"+toString(i)+"_MIN");
1183          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
1184                              dest,"out_DEPTH_"+toString(i)+"_MAX");
1185        }
1186     
1187      //   in_DEPTH_PREDICTION_UNIT_CURRENT                     - component_prediction_unit
1188      //   in_DEPTH_PREDICTION_UNIT_MIN                         - component_prediction_unit
1189      //   in_DEPTH_PREDICTION_UNIT_MAX                         - component_prediction_unit
1190      //  out_DEPTH_DECOD_UNIT_MIN                              - component_decod_unit
1191      //  out_DEPTH_DECOD_UNIT_MAX                              - component_decod_unit
1192      //  out_DEPTH_CONTEXT_STATE_MIN                           - component_context_state
1193     
1194      // ~~~~~[ Interface : "context"" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1195      //  out_CONTEXT_DECOD_UNIT_DEPTH                          - component_decod_unit
1196    }
1197   
1198    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1199#if DEBUG_Front_end == true
1200    _component->test_map(false);
1201#endif
1202
1203#ifdef POSITION
1204     if (usage_is_set(_usage,USE_POSITION))
1205       _component->generate_file();
1206#endif
1207
1208     log_end(Front_end,FUNCTION);
1209  };
1210
1211}; // end namespace front_end
1212}; // end namespace multi_front_end
1213}; // end namespace core
1214
1215}; // end namespace behavioural
1216}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.