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

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

1) Prediction unit : static prediction not blocking

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