source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_allocation.cpp @ 83

Last change on this file since 83 was 83, checked in by rosiere, 16 years ago

Add component : Context_State (manage miss prediction, exception , decod_enable, synchronisation instruction ...)

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