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

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

1) Add new algo in ifetch queue
2) Add Cancel bit
3) new config

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