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

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

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

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