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

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

Almost complete design
with Test and test platform

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