source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_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: 30.5 KB
Line 
1/*
2 * $Id: Decod_unit_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/Decod_unit/include/Decod_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace decod_unit {
17
18#undef  FUNCTION
19#define FUNCTION "Decod_unit::allocation"
20  void Decod_unit::allocation
21  (
22#ifdef STATISTICS
23   morpheo::behavioural::Parameters_Statistics * param_statistics
24#else
25   void
26#endif
27   )
28  {
29    log_begin(Decod_unit,FUNCTION);
30
31    _component   = new Component (_usage);
32
33    Entity * entity = _component->set_entity (_name       
34                                              ,"Decod_unit"
35#ifdef POSITION
36                                              ,COMBINATORY
37#endif
38                                              );
39
40    _interfaces = entity->set_interfaces();
41   
42    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43    {
44      Interface * interface = _interfaces->set_interface(""
45#ifdef POSITION
46                                                         ,IN
47                                                         ,SOUTH,
48                                                         "Generalist interface"
49#endif
50                                                         );
51     
52      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
53      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
54    }
55
56    // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57    {
58      ALLOC2_INTERFACE_BEGIN("ifetch", IN, WEST, _("Instruction's bundle"), _param->_nb_context, _param->_nb_inst_fetch[it1]);
59     
60      _ALLOC2_VALACK_IN ( in_IFETCH_VAL                       ,VAL, _param->_nb_context, _param->_nb_inst_fetch[it1]);
61      _ALLOC2_VALACK_OUT(out_IFETCH_ACK                       ,ACK, _param->_nb_context, _param->_nb_inst_fetch[it1]);
62      _ALLOC2_SIGNAL_IN ( in_IFETCH_INSTRUCTION               ,"instruction"                ,Tinstruction_t     ,_param->_size_instruction        ,_param->_nb_context, _param->_nb_inst_fetch[it1]);
63      _ALLOC2_SIGNAL_IN (in_IFETCH_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id         ,_param->_nb_context, _param->_nb_inst_fetch[it1]);
64      _ALLOC2_SIGNAL_IN (in_IFETCH_ADDRESS                    ,"address"                    ,Tgeneral_address_t ,_param->_size_instruction_address,_param->_nb_context, _param->_nb_inst_fetch[it1]);
65//    _ALLOC2_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT               ,"address_next"               ,Tgeneral_address_t ,_param->_size_instruction_address,_param->_nb_context, _param->_nb_inst_fetch[it1]);
66//    _ALLOC2_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr    ,_param->_nb_context, _param->_nb_inst_fetch[it1]);
67      _ALLOC2_SIGNAL_IN (in_IFETCH_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state       ,_param->_nb_context, _param->_nb_inst_fetch[it1]);
68      _ALLOC2_SIGNAL_IN (in_IFETCH_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth              ,_param->_nb_context, _param->_nb_inst_fetch[it1]);
69      _ALLOC2_SIGNAL_IN (in_IFETCH_EXCEPTION                  ,"exception"                  ,Texception_t       ,_param->_size_exception_ifetch   ,_param->_nb_context, _param->_nb_inst_fetch[it1]);
70
71      ALLOC2_INTERFACE_END(_param->_nb_context, _param->_nb_inst_fetch[it1]);
72    }
73
74    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
75    {
76      ALLOC1_INTERFACE_BEGIN("decod", OUT, EAST, _("Instruction decoded"), _param->_nb_inst_decod);
77
78      ALLOC1_VALACK_OUT(out_DECOD_VAL          ,VAL);
79      ALLOC1_VALACK_IN ( in_DECOD_ACK          ,ACK);
80      ALLOC1_SIGNAL_OUT(out_DECOD_CONTEXT_ID   ,"context_id"   ,Tcontext_t        ,_param->_size_context_id            );
81      ALLOC1_SIGNAL_OUT(out_DECOD_DEPTH        ,"depth"        ,Tdepth_t          ,_param->_size_depth                 );
82      ALLOC1_SIGNAL_OUT(out_DECOD_TYPE         ,"type"         ,Ttype_t           ,_param->_size_type                  );
83      ALLOC1_SIGNAL_OUT(out_DECOD_OPERATION    ,"operation"    ,Toperation_t      ,_param->_size_operation             );
84      ALLOC1_SIGNAL_OUT(out_DECOD_NO_EXECUTE   ,"no_execute"   ,Tcontrol_t        ,1                                   );
85//    ALLOC1_SIGNAL_OUT(out_DECOD_HAVE_EVENT   ,"have_event"   ,Tcontrol_t        ,1                                   );
86      ALLOC1_SIGNAL_OUT(out_DECOD_LAST_EVENT   ,"last_event"   ,Tcontrol_t        ,1                                   );
87      ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t        ,1                                   );
88#ifdef DEBUG
89      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS      ,"address"      ,Tgeneral_data_t   ,_param->_size_instruction_address   );
90#endif
91      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS_NEXT ,"address_next" ,Tgeneral_data_t   ,_param->_size_instruction_address   );
92      ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t        ,1                                   );
93      ALLOC1_SIGNAL_OUT(out_DECOD_IMMEDIAT     ,"immediat"     ,Tgeneral_data_t   ,_param->_size_general_data          );
94      ALLOC1_SIGNAL_OUT(out_DECOD_READ_RA      ,"read_ra"      ,Tcontrol_t        ,1                                   );
95      ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RA   ,"num_reg_ra"   ,Tgeneral_address_t,_param->_size_general_register_logic);
96      ALLOC1_SIGNAL_OUT(out_DECOD_READ_RB      ,"read_rb"      ,Tcontrol_t        ,1                                   );
97      ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RB   ,"num_reg_rb"   ,Tgeneral_address_t,_param->_size_general_register_logic);
98      ALLOC1_SIGNAL_OUT(out_DECOD_READ_RC      ,"read_rc"      ,Tcontrol_t        ,1                                   );
99      ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RC   ,"num_reg_rc"   ,Tspecial_address_t,_param->_size_special_register_logic);
100      ALLOC1_SIGNAL_OUT(out_DECOD_WRITE_RD     ,"write_rd"     ,Tcontrol_t        ,1                                   );
101      ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RD   ,"num_reg_rd"   ,Tgeneral_address_t,_param->_size_general_register_logic);
102      ALLOC1_SIGNAL_OUT(out_DECOD_WRITE_RE     ,"write_re"     ,Tcontrol_t        ,1                                   );
103      ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RE   ,"num_reg_re"   ,Tspecial_address_t,_param->_size_special_register_logic);
104      ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION_USE,"exception_use",Texception_t      ,_param->_size_exception_use         );
105      ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION    ,"exception"    ,Texception_t      ,_param->_size_exception_decod       );
106   
107      ALLOC1_INTERFACE_END(_param->_nb_inst_decod);
108    }
109
110    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111    {
112      ALLOC1_INTERFACE_BEGIN("predict",OUT,NORTH,_("Decod a branch -> inform the branch predictor."),_param->_nb_inst_decod);
113
114      ALLOC1_VALACK_OUT(out_PREDICT_VAL                        ,VAL);
115      ALLOC1_VALACK_IN ( in_PREDICT_ACK                        ,ACK);
116      ALLOC1_SIGNAL_OUT(out_PREDICT_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      );
117      ALLOC1_SIGNAL_OUT(out_PREDICT_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             );
118      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    );
119      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth           );
120      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition);
121//    ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE         ,"branch_stack_write"         ,Tcontrol_t         ,1                             );
122      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             );
123      ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC                ,"address_src"                ,Tgeneral_data_t    ,_param->_size_instruction_address    );
124      ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST               ,"address_dest"               ,Tgeneral_data_t    ,_param->_size_instruction_address    );
125      ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE               ,"can_continue"               ,Tcontrol_t         ,1                             );
126   
127      ALLOC1_INTERFACE_END(_param->_nb_inst_decod);
128    }
129   
130    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
131    {
132      ALLOC1_INTERFACE_BEGIN("depth",IN ,NORTH,_("Depth"), _param->_nb_context);
133
134      ALLOC1_SIGNAL_IN ( in_DEPTH_MIN      ,"min"      ,Tdepth_t           ,_param->_size_depth);
135      ALLOC1_SIGNAL_IN ( in_DEPTH_MAX      ,"max"      ,Tdepth_t           ,_param->_size_depth);
136      ALLOC1_SIGNAL_IN ( in_DEPTH_FULL     ,"full"     ,Tcontrol_t         ,1);
137
138      ALLOC1_INTERFACE_END(_param->_nb_context);
139    }
140
141    // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
142    {
143      ALLOC1_INTERFACE_BEGIN("nb_inst",OUT,NORTH,_("Instruction's number"), _param->_nb_context);
144
145      ALLOC1_SIGNAL_OUT(out_NB_INST_DECOD_ALL  ,"decod_all"   ,Tcounter_t         ,_param->_size_nb_inst_decod);
146
147      ALLOC1_INTERFACE_END(_param->_nb_context);
148    }
149   
150    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151    {
152      ALLOC1_INTERFACE_BEGIN("context", IN, NORTH, _("context's information"), _param->_nb_context);
153
154      ALLOC1_SIGNAL_IN (in_CONTEXT_DECOD_ENABLE,"decod_enable",Tcontrol_t,1);
155      ALLOC1_SIGNAL_IN (in_CONTEXT_EVENT       ,"event"       ,Tcontrol_t,1);
156      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH_VAL   ,"depth_val"   ,Tcontrol_t,1);
157      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH       ,"depth"       ,Tdepth_t  ,_param->_size_depth);
158
159      ALLOC1_INTERFACE_END(_param->_nb_context);
160    }
161
162    // ~~~~~[ Interface : "context_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
163    {
164      ALLOC0_INTERFACE_BEGIN("context_event", OUT, NORTH, _("context's evenement"));
165
166      ALLOC0_VALACK_OUT(out_CONTEXT_EVENT_VAL          ,VAL);
167      ALLOC0_VALACK_IN ( in_CONTEXT_EVENT_ACK          ,ACK);
168      ALLOC0_SIGNAL_OUT(out_CONTEXT_EVENT_CONTEXT_ID   ,"context_id"   ,Tcontext_t     ,_param->_size_context_id  );
169      ALLOC0_SIGNAL_OUT(out_CONTEXT_EVENT_DEPTH        ,"depth"        ,Tdepth_t       ,_param->_size_depth       );
170      ALLOC0_SIGNAL_OUT(out_CONTEXT_EVENT_TYPE         ,"type"         ,Tevent_type_t  ,_param->_size_event_type  );
171      ALLOC0_SIGNAL_OUT(out_CONTEXT_EVENT_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t     ,1                         );
172      ALLOC0_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS      ,"address"      ,Tgeneral_data_t,_param->_size_instruction_address);
173      ALLOC0_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_instruction_address);
174
175      ALLOC0_INTERFACE_END();
176    }
177   
178    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179    std::string src,dest;
180   
181    {
182      src = _name+"_decod";
183      log_printf(INFO,Decod_unit,FUNCTION,_("Create   : %s"),src.c_str());
184     
185      _component_decod = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Decod
186        (src.c_str()
187#ifdef STATISTICS
188         ,param_statistics
189#endif
190         ,_param->_param_decod
191         ,_usage);
192     
193      _component->set_component (_component_decod->_component
194#ifdef POSITION
195                                 , 50, 50, 10, 10
196#endif
197                                 );
198    }
199   
200    {
201      src = _name+"_decod_queue";
202      log_printf(INFO,Decod_unit,FUNCTION,_("Create   : %s"),src.c_str());
203     
204      _component_decod_queue = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue
205        (src.c_str()
206#ifdef STATISTICS
207         ,param_statistics
208#endif
209         ,_param->_param_decod_queue
210         ,_usage);
211     
212      _component->set_component (_component_decod_queue->_component
213#ifdef POSITION
214                                 , 50, 50, 10, 10
215#endif
216                                 );
217    }
218   
219    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
220
221    // ===================================================================
222    // =====[ decod ]=====================================================
223    // ===================================================================
224    {
225      src = _name+"_decod";
226      log_printf(INFO,Decod_unit,FUNCTION,_("Instance : %s"),src.c_str());
227           
228      {
229        dest = _name;
230#ifdef POSITION
231        _component->interface_map (src ,"",
232                                   dest,"");
233#endif
234        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
235        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
236      }
237
238      for (uint32_t i=0; i<_param->_nb_context; i++)
239        {
240          dest = _name;
241       
242          for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; j++)
243            {
244#ifdef POSITION
245              _component->interface_map (src ,"ifetch_"+toString(i)+"_"+toString(j),
246                                         dest,"ifetch_"+toString(i)+"_"+toString(j));
247#endif
248             
249              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_VAL"        ,
250                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_VAL"        );
251              PORT_MAP(_component,src ,"out_IFETCH_"+toString(i)+"_"+toString(j)+"_ACK"        ,
252                                  dest,"out_IFETCH_"+toString(i)+"_"+toString(j)+"_ACK"        );
253              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_INSTRUCTION",
254                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_INSTRUCTION");
255              if (_param->_have_port_context_id)
256              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 ,
257                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 );
258              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_ADDRESS"                    ,
259                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_ADDRESS"                    );
260//            PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_ADDRESS_NEXT"               ,
261//                                dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_ADDRESS_NEXT"               );
262//            if (_param->_have_port_inst_ifetch_ptr)
263//            PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_INST_IFETCH_PTR"            ,
264//                                dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_INST_IFETCH_PTR"            );
265              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               ,
266                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
267              if (_param->_have_port_depth)
268              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID",
269                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
270              PORT_MAP(_component,src , "in_IFETCH_"+toString(i)+"_"+toString(j)+"_EXCEPTION"                  ,
271                                  dest, "in_IFETCH_"+toString(i)+"_"+toString(j)+"_EXCEPTION"                  );
272            }
273 
274        }
275       
276      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
277        {
278          dest = _name+"_decod_queue";
279
280#ifdef POSITION
281          _component->interface_map (src ,"decod_"   +toString(i),
282                                     dest,"decod_in_"+toString(i));
283#endif
284
285          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_VAL"          ,
286                                   dest, "in_DECOD_IN_"+toString(i)+"_VAL"          );
287          COMPONENT_MAP(_component,src , "in_DECOD_"   +toString(i)+"_ACK"          ,
288                                   dest,"out_DECOD_IN_"+toString(i)+"_ACK"          );
289          if (_param->_have_port_context_id)
290          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_CONTEXT_ID"   ,
291                                   dest, "in_DECOD_IN_"+toString(i)+"_CONTEXT_ID"   );
292          if (_param->_have_port_depth)
293          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_DEPTH"        ,
294                                   dest, "in_DECOD_IN_"+toString(i)+"_DEPTH"        );
295          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_TYPE"         ,
296                                   dest, "in_DECOD_IN_"+toString(i)+"_TYPE"         );
297          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_OPERATION"    ,
298                                   dest, "in_DECOD_IN_"+toString(i)+"_OPERATION"    );
299          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_NO_EXECUTE"   ,
300                                   dest, "in_DECOD_IN_"+toString(i)+"_NO_EXECUTE"   );
301          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_IS_DELAY_SLOT",
302                                   dest, "in_DECOD_IN_"+toString(i)+"_IS_DELAY_SLOT");
303#ifdef DEBUG
304          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_ADDRESS"      ,
305                                   dest, "in_DECOD_IN_"+toString(i)+"_ADDRESS"      );
306#endif
307          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_ADDRESS_NEXT" ,
308                                   dest, "in_DECOD_IN_"+toString(i)+"_ADDRESS_NEXT" );
309          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_HAS_IMMEDIAT" ,
310                                   dest, "in_DECOD_IN_"+toString(i)+"_HAS_IMMEDIAT" );
311          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_IMMEDIAT"     ,
312                                   dest, "in_DECOD_IN_"+toString(i)+"_IMMEDIAT"     );
313          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_READ_RA"      ,
314                                   dest, "in_DECOD_IN_"+toString(i)+"_READ_RA"      );
315          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_NUM_REG_RA"   ,
316                                   dest, "in_DECOD_IN_"+toString(i)+"_NUM_REG_RA"   );
317          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_READ_RB"      ,
318                                   dest, "in_DECOD_IN_"+toString(i)+"_READ_RB"      );
319          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_NUM_REG_RB"   ,
320                                   dest, "in_DECOD_IN_"+toString(i)+"_NUM_REG_RB"   );
321          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_READ_RC"      ,
322                                   dest, "in_DECOD_IN_"+toString(i)+"_READ_RC"      );
323          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_NUM_REG_RC"   ,
324                                   dest, "in_DECOD_IN_"+toString(i)+"_NUM_REG_RC"   );
325          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_WRITE_RD"     ,
326                                   dest, "in_DECOD_IN_"+toString(i)+"_WRITE_RD"     );
327          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_NUM_REG_RD"   ,
328                                   dest, "in_DECOD_IN_"+toString(i)+"_NUM_REG_RD"   );
329          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_WRITE_RE"     ,
330                                   dest, "in_DECOD_IN_"+toString(i)+"_WRITE_RE"     );
331          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_NUM_REG_RE"   ,
332                                   dest, "in_DECOD_IN_"+toString(i)+"_NUM_REG_RE"   );
333          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_EXCEPTION_USE",
334                                   dest, "in_DECOD_IN_"+toString(i)+"_EXCEPTION_USE");
335          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_EXCEPTION"    ,
336                                   dest, "in_DECOD_IN_"+toString(i)+"_EXCEPTION"    );
337        }
338
339      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
340        {
341          dest = _name;
342
343#ifdef POSITION
344          _component->interface_map (src ,"predict"+toString(i),
345                                     dest,"predict"+toString(i));
346#endif
347
348          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_VAL"                        ,
349                              dest,"out_PREDICT_"+toString(i)+"_VAL"                        );
350          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_ACK"                        ,
351                              dest, "in_PREDICT_"+toString(i)+"_ACK"                        );
352          if (_param->_have_port_context_id)
353          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_CONTEXT_ID"                 ,
354                              dest,"out_PREDICT_"+toString(i)+"_CONTEXT_ID"                 );
355          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_MATCH_INST_IFETCH_PTR"      ,
356                              dest,"out_PREDICT_"+toString(i)+"_MATCH_INST_IFETCH_PTR"      );
357          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               ,
358                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
359          if (_param->_have_port_depth)
360          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID",
361                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
362          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_CONDITION"           ,
363                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_CONDITION"           );
364//        PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STACK_WRITE"         ,
365//                            dest,"out_PREDICT_"+toString(i)+"_BRANCH_STACK_WRITE"         );
366          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_DIRECTION"           ,
367                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_DIRECTION"           );
368          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ADDRESS_SRC"                ,
369                              dest,"out_PREDICT_"+toString(i)+"_ADDRESS_SRC"                );
370          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ADDRESS_DEST"               ,
371                              dest,"out_PREDICT_"+toString(i)+"_ADDRESS_DEST"               );
372          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_CAN_CONTINUE"               ,
373                              dest, "in_PREDICT_"+toString(i)+"_CAN_CONTINUE"               );
374        }
375
376      for (uint32_t i=0; i<_param->_nb_context; i++)
377        {
378          dest = _name;
379
380#ifdef POSITION
381          _component->interface_map (src ,"context_"+toString(i),
382                                     dest,"context_"+toString(i));
383#endif
384         
385          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_DECOD_ENABLE",
386                              dest, "in_CONTEXT_"+toString(i)+"_DECOD_ENABLE");
387          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_DEPTH_VAL"   ,
388                              dest, "in_CONTEXT_"+toString(i)+"_DEPTH_VAL"   );
389          if (_param->_have_port_depth)
390          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_DEPTH"       ,
391                              dest, "in_CONTEXT_"+toString(i)+"_DEPTH"       );
392        }
393
394      {
395        dest = _name;
396       
397#ifdef POSITION
398        _component->interface_map (src ,"context_event",
399                                   dest,"context_event");
400#endif
401
402        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_VAL"          ,
403                            dest,"out_CONTEXT_EVENT_VAL"          );
404        PORT_MAP(_component,src , "in_CONTEXT_EVENT_ACK"          ,
405                            dest, "in_CONTEXT_EVENT_ACK"          );
406        if (_param->_have_port_context_id)
407        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_CONTEXT_ID"   ,
408                            dest,"out_CONTEXT_EVENT_CONTEXT_ID"   );
409        if (_param->_have_port_depth)
410        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_DEPTH"        ,
411                            dest,"out_CONTEXT_EVENT_DEPTH"        );
412        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_TYPE"         ,
413                            dest,"out_CONTEXT_EVENT_TYPE"         );
414        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_IS_DELAY_SLOT",
415                            dest,"out_CONTEXT_EVENT_IS_DELAY_SLOT");
416        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS"      ,
417                            dest,"out_CONTEXT_EVENT_ADDRESS"      );
418        PORT_MAP(_component,src ,"out_CONTEXT_EVENT_ADDRESS_EPCR" ,
419                            dest,"out_CONTEXT_EVENT_ADDRESS_EPCR" );
420
421      }
422    }
423
424    // ===================================================================
425    // =====[ decod_queue ]===============================================
426    // ===================================================================
427    {
428      src = _name+"_decod_queue";
429      log_printf(INFO,Decod_unit,FUNCTION,_("Instance : %s"),src.c_str());
430           
431      {
432        dest = _name;
433#ifdef POSITION
434        _component->interface_map (src ,"",
435                                   dest,"");
436#endif
437        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
438        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
439      }
440
441      // in_DECOD_IN_VAL            - component decod
442      //out_DECOD_IN_ACK            - component decod
443      // in_DECOD_IN_CONTEXT_ID     - component decod
444      // in_DECOD_IN_DEPTH          - component decod
445      // in_DECOD_IN_TYPE           - component decod
446      // in_DECOD_IN_OPERATION      - component decod
447      // in_DECOD_IN_NO_EXECUTE     - component decod
448      // in_DECOD_IN_IS_DELAY_SLOT  - component decod
449      // in_DECOD_IN_ADDRESS        - component decod
450      // in_DECOD_IN_ADDRESS_NEXT   - component decod
451      // in_DECOD_IN_HAS_IMMEDIAT   - component decod
452      // in_DECOD_IN_IMMEDIAT       - component decod
453      // in_DECOD_IN_READ_RA        - component decod
454      // in_DECOD_IN_NUM_REG_RA     - component decod
455      // in_DECOD_IN_READ_RB        - component decod
456      // in_DECOD_IN_NUM_REG_RB     - component decod
457      // in_DECOD_IN_READ_RC        - component decod
458      // in_DECOD_IN_NUM_REG_RC     - component decod
459      // in_DECOD_IN_WRITE_RD       - component decod
460      // in_DECOD_IN_NUM_REG_RD     - component decod
461      // in_DECOD_IN_WRITE_RE       - component decod
462      // in_DECOD_IN_NUM_REG_RE     - component decod
463      // in_DECOD_IN_EXCEPTION_USE  - component decod
464      // in_DECOD_IN_EXCEPTION      - component decod
465
466      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
467        {
468          dest = _name;
469
470#ifdef POSITION
471          _component->interface_map (src ,"decod_out_"+toString(i),
472                                     dest,"decod"     +toString(i));
473#endif
474
475          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_VAL"          ,
476                              dest,"out_DECOD_"    +toString(i)+"_VAL"          );
477          PORT_MAP(_component,src , "in_DECOD_OUT_"+toString(i)+"_ACK"          ,
478                              dest, "in_DECOD_"    +toString(i)+"_ACK"          );
479          if (_param->_have_port_context_id)
480          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_CONTEXT_ID"   ,
481                              dest,"out_DECOD_"    +toString(i)+"_CONTEXT_ID"   );
482          if (_param->_have_port_depth)
483          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_DEPTH"        ,
484                              dest,"out_DECOD_"    +toString(i)+"_DEPTH"        );
485          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_TYPE"         ,
486                              dest,"out_DECOD_"    +toString(i)+"_TYPE"         );
487          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_OPERATION"    ,
488                              dest,"out_DECOD_"    +toString(i)+"_OPERATION"    );
489          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NO_EXECUTE"   ,
490                              dest,"out_DECOD_"    +toString(i)+"_NO_EXECUTE"   );
491//        PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_HAVE_EVENT"   ,
492//                            dest,"out_DECOD_"    +toString(i)+"_HAVE_EVENT"   );
493          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_LAST_EVENT"   ,
494                              dest,"out_DECOD_"    +toString(i)+"_LAST_EVENT"   );
495          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_IS_DELAY_SLOT",
496                              dest,"out_DECOD_"    +toString(i)+"_IS_DELAY_SLOT");
497#ifdef DEBUG
498          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_ADDRESS"      ,
499                              dest,"out_DECOD_"    +toString(i)+"_ADDRESS"      );
500#endif
501          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_ADDRESS_NEXT" ,
502                              dest,"out_DECOD_"    +toString(i)+"_ADDRESS_NEXT" );
503          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_HAS_IMMEDIAT" ,
504                              dest,"out_DECOD_"    +toString(i)+"_HAS_IMMEDIAT" );
505          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_IMMEDIAT"     ,
506                              dest,"out_DECOD_"    +toString(i)+"_IMMEDIAT"     );
507          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_READ_RA"      ,
508                              dest,"out_DECOD_"    +toString(i)+"_READ_RA"      );
509          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NUM_REG_RA"   ,
510                              dest,"out_DECOD_"    +toString(i)+"_NUM_REG_RA"   );
511          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_READ_RB"      ,
512                              dest,"out_DECOD_"    +toString(i)+"_READ_RB"      );
513          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NUM_REG_RB"   ,
514                              dest,"out_DECOD_"    +toString(i)+"_NUM_REG_RB"   );
515          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_READ_RC"      ,
516                              dest,"out_DECOD_"    +toString(i)+"_READ_RC"      );
517          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NUM_REG_RC"   ,
518                              dest,"out_DECOD_"    +toString(i)+"_NUM_REG_RC"   );
519          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_WRITE_RD"     ,
520                              dest,"out_DECOD_"    +toString(i)+"_WRITE_RD"     );
521          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NUM_REG_RD"   ,
522                              dest,"out_DECOD_"    +toString(i)+"_NUM_REG_RD"   );
523          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_WRITE_RE"     ,
524                              dest,"out_DECOD_"    +toString(i)+"_WRITE_RE"     );
525          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NUM_REG_RE"   ,
526                              dest,"out_DECOD_"    +toString(i)+"_NUM_REG_RE"   );
527          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_EXCEPTION_USE",
528                              dest,"out_DECOD_"    +toString(i)+"_EXCEPTION_USE");
529          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_EXCEPTION"    ,
530                              dest,"out_DECOD_"    +toString(i)+"_EXCEPTION"    );
531        }
532
533      for (uint32_t i=0; i<_param->_nb_context; i++)
534        {
535          dest = _name;
536
537#ifdef POSITION
538          _component->interface_map (src ,"depth"+toString(i),
539                                     dest,"depth"+toString(i));
540#endif
541
542          if (_param->_have_port_depth)
543            {
544          PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_MIN",
545                              dest, "in_DEPTH_"+toString(i)+"_MIN");
546          PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_MAX",
547                              dest, "in_DEPTH_"+toString(i)+"_MAX");
548            }
549          PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_FULL",
550                              dest, "in_DEPTH_"+toString(i)+"_FULL");
551        }
552
553      for (uint32_t i=0; i<_param->_nb_context; i++)
554        {
555          dest = _name;
556
557#ifdef POSITION
558          _component->interface_map (src ,"nb_inst"+toString(i),
559                                     dest,"nb_inst"+toString(i));
560#endif
561
562          PORT_MAP(_component,src ,"out_NB_INST_"+toString(i)+      "_ALL",
563                              dest,"out_NB_INST_"+toString(i)+"_DECOD_ALL");
564        }
565
566
567
568      for (uint32_t i=0; i<_param->_nb_context; i++)
569        {
570          dest = _name;
571
572#ifdef POSITION
573          _component->interface_map (src ,"context_"+toString(i),
574                                     dest,"context_"+toString(i));
575#endif
576         
577          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_EVENT"       ,
578                              dest, "in_CONTEXT_"+toString(i)+"_EVENT"       );
579
580        }
581    }
582    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
583#if DEBUG_Decod_unit == true
584      _component->test_map();
585#endif
586
587#ifdef POSITION
588    if (usage_is_set(_usage,USE_POSITION))
589      _component->generate_file();
590#endif
591   
592    log_end(Decod_unit,FUNCTION);
593  };
594
595}; // end namespace decod_unit
596}; // end namespace front_end
597}; // end namespace multi_front_end
598}; // end namespace core
599
600}; // end namespace behavioural
601}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.