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

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

1) decod_queue : add reg_LAST_SLOT.
2) Commit : insert on event -> to pop decod_queue. Head test : add information (speculative or not)
3) Context State / UPT : Branch miss and Load miss in same cycle.
4) Free List : Bank is on LSB not MSB.
5) Platforms : move data

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