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

Last change on this file since 138 was 137, checked in by rosiere, 14 years ago

Various modif (add test, and vhdl)

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