source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp @ 128

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

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

  • Property svn:keywords set to Id
File size: 33.1 KB
Line 
1/*
2 * $Id: Register_unit_allocation.cpp 128 2009-06-26 08:43:23Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Register_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace register_unit {
17
18#undef  FUNCTION
19#define FUNCTION "Register_unit::allocation"
20  void Register_unit::allocation (
21#ifdef STATISTICS
22                                  morpheo::behavioural::Parameters_Statistics * param_statistics
23#else
24                                  void
25#endif
26                                  )
27  {
28    log_printf(FUNC,Register_unit,FUNCTION,"Begin");
29
30    _component   = new Component (_usage);
31
32    Entity * entity = _component->set_entity (_name       
33                                              ,"Register_unit"
34#ifdef POSITION
35                                              ,COMBINATORY
36#endif
37                                              );
38
39    _interfaces = entity->set_interfaces();
40
41    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
43    Interface * interface = _interfaces->set_interface(""
44#ifdef POSITION
45                                                       ,IN
46                                                       ,SOUTH,
47                                                       "Generalist interface"
48#endif
49                                                       );
50
51    in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
52    in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
53
54    // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55    {
56      ALLOC1_INTERFACE_BEGIN("gpr_read",IN,NORTH,_("Interface to read the register file"),_param->_nb_gpr_read);
57     
58      ALLOC1_VALACK_IN ( in_GPR_READ_VAL          ,VAL);
59      ALLOC1_VALACK_OUT(out_GPR_READ_ACK          ,ACK);
60      ALLOC1_SIGNAL_IN ( in_GPR_READ_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
61      ALLOC1_SIGNAL_IN ( in_GPR_READ_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_gpr_address);
62      ALLOC1_SIGNAL_OUT(out_GPR_READ_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_data);
63      ALLOC1_SIGNAL_OUT(out_GPR_READ_DATA_VAL     ,"data_val"     ,Tcontrol_t        ,1);
64
65      ALLOC1_INTERFACE_END(_param->_nb_gpr_read);
66    }
67
68    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69    {
70      ALLOC1_INTERFACE_BEGIN("gpr_write",IN,NORTH,_("Interface to write the register file"),_param->_nb_gpr_write);
71
72      ALLOC1_VALACK_IN ( in_GPR_WRITE_VAL          ,VAL);
73      ALLOC1_VALACK_OUT(out_GPR_WRITE_ACK          ,ACK);
74      ALLOC1_SIGNAL_IN ( in_GPR_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
75      ALLOC1_SIGNAL_IN ( in_GPR_WRITE_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_gpr_address);
76      ALLOC1_SIGNAL_IN ( in_GPR_WRITE_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_data);
77
78      ALLOC1_INTERFACE_END(_param->_nb_gpr_write);
79    }
80
81    // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82    {
83      ALLOC1_INTERFACE_BEGIN("spr_read",IN,NORTH,_("Interface to read the register file"),_param->_nb_spr_read);
84     
85      ALLOC1_VALACK_IN ( in_SPR_READ_VAL          ,VAL);
86      ALLOC1_VALACK_OUT(out_SPR_READ_ACK          ,ACK);
87      ALLOC1_SIGNAL_IN ( in_SPR_READ_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
88      ALLOC1_SIGNAL_IN ( in_SPR_READ_NUM_REG      ,"num_reg"      ,Tspecial_address_t,_param->_size_spr_address);
89      ALLOC1_SIGNAL_OUT(out_SPR_READ_DATA         ,"data"         ,Tspecial_data_t   ,_param->_size_special_data);
90      ALLOC1_SIGNAL_OUT(out_SPR_READ_DATA_VAL     ,"data_val"     ,Tcontrol_t        ,1);
91
92      ALLOC1_INTERFACE_END(_param->_nb_spr_read);
93    }
94
95    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96    {
97      ALLOC1_INTERFACE_BEGIN("spr_write",IN,NORTH,_("Interface to write the register file"),_param->_nb_spr_write);
98
99      ALLOC1_VALACK_IN ( in_SPR_WRITE_VAL          ,VAL);
100      ALLOC1_VALACK_OUT(out_SPR_WRITE_ACK          ,ACK);
101      ALLOC1_SIGNAL_IN ( in_SPR_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id);
102      ALLOC1_SIGNAL_IN ( in_SPR_WRITE_NUM_REG      ,"num_reg"      ,Tspecial_address_t,_param->_size_spr_address);
103      ALLOC1_SIGNAL_IN ( in_SPR_WRITE_DATA         ,"data"         ,Tspecial_data_t   ,_param->_size_special_data);
104
105      ALLOC1_INTERFACE_END(_param->_nb_spr_write);
106    }
107
108    // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109    {
110      ALLOC2_INTERFACE_BEGIN("insert_rob",IN,WEST,_("Interface to update status (insert)"),_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
111     
112      _ALLOC2_VALACK_IN ( in_INSERT_ROB_VAL       ,VAL                                                      ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
113      _ALLOC2_VALACK_OUT(out_INSERT_ROB_ACK       ,ACK                                                      ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
114      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RD_USE    ,"rd_use"    ,Tcontrol_t        ,1                        ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
115      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RD_NUM_REG,"rd_num_reg",Tgeneral_address_t,_param->_size_gpr_address,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
116      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RE_USE    ,"re_use"    ,Tcontrol_t        ,1                        ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
117      _ALLOC2_SIGNAL_IN ( in_INSERT_ROB_RE_NUM_REG,"re_num_reg",Tspecial_address_t,_param->_size_spr_address,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
118     
119      ALLOC2_INTERFACE_END(_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1]);
120    }
121
122//     // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123//     in_RETIRE_ROB_VAL            = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
124//     out_RETIRE_ROB_ACK            = new SC_OUT(Tcontrol_t        )  ** [_param->_nb_ooo_engine];
125//     in_RETIRE_ROB_RD_OLD_USE     = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
126//     in_RETIRE_ROB_RD_OLD_NUM_REG = new SC_IN (Tgeneral_address_t)  ** [_param->_nb_ooo_engine];
127//     in_RETIRE_ROB_RE_OLD_USE     = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
128//     in_RETIRE_ROB_RE_OLD_NUM_REG = new SC_IN (Tspecial_address_t)  ** [_param->_nb_ooo_engine];
129//     in_RETIRE_ROB_RD_NEW_USE     = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
130//     in_RETIRE_ROB_RD_NEW_NUM_REG = new SC_IN (Tgeneral_address_t)  ** [_param->_nb_ooo_engine];
131//     in_RETIRE_ROB_RE_NEW_USE     = new SC_IN (Tcontrol_t        )  ** [_param->_nb_ooo_engine];
132//     in_RETIRE_ROB_RE_NEW_NUM_REG = new SC_IN (Tspecial_address_t)  ** [_param->_nb_ooo_engine];
133
134//     for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
135//       {
136//      uint32_t x=_param->_nb_inst_retire_rob [i];
137
138//      in_RETIRE_ROB_VAL            [i] = new SC_IN (Tcontrol_t        )  * [x];
139//      out_RETIRE_ROB_ACK            [i] = new SC_OUT(Tcontrol_t        )  * [x];
140//      in_RETIRE_ROB_RD_OLD_USE     [i] = new SC_IN (Tcontrol_t        )  * [x];
141//      in_RETIRE_ROB_RD_OLD_NUM_REG [i] = new SC_IN (Tgeneral_address_t)  * [x];
142//      in_RETIRE_ROB_RE_OLD_USE     [i] = new SC_IN (Tcontrol_t        )  * [x];
143//      in_RETIRE_ROB_RE_OLD_NUM_REG [i] = new SC_IN (Tspecial_address_t)  * [x];
144//      in_RETIRE_ROB_RD_NEW_USE     [i] = new SC_IN (Tcontrol_t        )  * [x];
145//      in_RETIRE_ROB_RD_NEW_NUM_REG [i] = new SC_IN (Tgeneral_address_t)  * [x];
146//      in_RETIRE_ROB_RE_NEW_USE     [i] = new SC_IN (Tcontrol_t        )  * [x];
147//      in_RETIRE_ROB_RE_NEW_NUM_REG [i] = new SC_IN (Tspecial_address_t)  * [x];
148
149//      for (uint32_t j=0; j<x; j++)
150//        {
151//          Interface_fifo * interface = _interfaces->set_interface("retire_rob_"+toString(i)+"_"+toString(j)
152// #ifdef POSITION
153//                                                                  ,IN
154//                                                                  ,WEST
155//                                                                  ,"Interface to update status (retire)"
156// #endif
157//                                                                  );
158
159
160//          in_RETIRE_ROB_VAL            [i][j] = interface->set_signal_valack_in  (VAL);
161//         out_RETIRE_ROB_ACK            [i][j] = interface->set_signal_valack_out (ACK);
162//          in_RETIRE_ROB_RD_OLD_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("rd_old_use"    , 1);
163//          in_RETIRE_ROB_RD_OLD_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_old_num_reg", _param->_size_gpr_address);
164//          in_RETIRE_ROB_RE_OLD_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("re_old_use"    , 1);
165//          in_RETIRE_ROB_RE_OLD_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_old_num_reg", _param->_size_spr_address);
166//          in_RETIRE_ROB_RD_NEW_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("rd_new_use"    , 1);
167//          in_RETIRE_ROB_RD_NEW_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_new_num_reg", _param->_size_gpr_address);
168//          in_RETIRE_ROB_RE_NEW_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("re_new_use"    , 1);
169//          in_RETIRE_ROB_RE_NEW_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_new_num_reg", _param->_size_spr_address);
170//        }
171//       }
172
173    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
174
175    std::string name;
176     
177    component_gpr        = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile * [_param->_nb_ooo_engine];
178    component_gpr_status = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile * [_param->_nb_ooo_engine];
179    component_spr        = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile * [_param->_nb_ooo_engine];
180    component_spr_status = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile * [_param->_nb_ooo_engine];
181     
182    for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
183      {
184        name = _name+"_gpr_"+toString(i);
185        log_printf(INFO,Register_unit,FUNCTION,_("Create   : %s"),name.c_str());
186
187        component_gpr        [i] = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile
188          (name.c_str()
189#ifdef STATISTICS
190           ,param_statistics
191#endif
192           ,_param->_param_gpr [i]
193           ,_usage
194           );
195         
196        _component->set_component (component_gpr[i]->_component
197#ifdef POSITION
198                                   , 50
199                                   , 50
200                                   , 10
201                                   , 10
202#endif
203                                   );
204
205
206        name = _name+"_gpr_status_"+toString(i);
207        log_printf(INFO,Register_unit,FUNCTION,_("Create   : %s"),name.c_str());
208
209        component_gpr_status [i] = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile
210          (name.c_str()
211#ifdef STATISTICS
212           ,param_statistics
213#endif
214           ,_param->_param_gpr_status [i]
215           ,_usage
216           );
217
218        _component->set_component (component_gpr_status[i]->_component
219#ifdef POSITION
220                                   , 50
221                                   , 50
222                                   , 10
223                                   , 10
224#endif
225                                   );
226
227
228        name = _name+"_spr_"+toString(i);
229        log_printf(INFO,Register_unit,FUNCTION,_("Create   : %s"),name.c_str());
230         
231        component_spr        [i] = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile
232          (name.c_str()
233#ifdef STATISTICS
234           ,param_statistics
235#endif
236           ,_param->_param_spr [i]
237           ,_usage
238           );
239
240        _component->set_component (component_spr[i]->_component
241#ifdef POSITION
242                                   , 50
243                                   , 50
244                                   , 10
245                                   , 10
246#endif
247                                   );
248
249        name = _name+"_spr_status_"+toString(i);
250        log_printf(INFO,Register_unit,FUNCTION,_("Create   : %s"),name.c_str());
251
252        component_spr_status [i] = new morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile
253          (name.c_str()
254#ifdef STATISTICS
255           ,param_statistics
256#endif
257           ,_param->_param_spr_status [i]
258           ,_usage
259           );
260
261        _component->set_component (component_spr_status[i]->_component
262#ifdef POSITION
263                                   , 50
264                                   , 50
265                                   , 10
266                                   , 10
267#endif
268                                   );
269      }
270
271
272    name = _name+"_glue";
273    log_printf(INFO,Register_unit,FUNCTION,_("Create   : %s"),name.c_str());
274     
275    component_glue       = new morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Register_unit_Glue::Register_unit_Glue     
276      (name.c_str()
277#ifdef STATISTICS
278       ,param_statistics
279#endif
280       ,_param->_param_glue
281       ,_usage
282       );
283
284    _component->set_component (component_glue->_component
285#ifdef POSITION
286                               , 50
287                               , 50
288                               , 10
289                               , 10
290#endif
291                               );
292     
293    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
294    std::string src,dest;
295   
296    for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
297      {
298        src = _name+"_gpr_"+toString(i);
299       
300        log_printf(INFO,Register_unit,FUNCTION,_("Instance : %s"),src.c_str());
301       
302        {
303          dest = _name;
304#ifdef POSITION
305          _component->interface_map (src ,"",
306                                     dest,"");
307#endif
308          PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
309          PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
310        }
311
312        for (uint32_t j=0; j<_param->_nb_gpr_read; j++)
313          {
314            dest = _name+"_glue";
315           
316#ifdef POSITION
317            _component->interface_map (src ,    "read_"+toString(j),
318                                       dest,"gpr_read_registerfile_"+toString(i)+"_"+toString(j));
319#endif
320
321            COMPONENT_MAP(_component,src , "in_READ_"                                 +toString(j)+"_VAL",
322                                     dest,"out_GPR_READ_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_VAL");
323            COMPONENT_MAP(_component,src ,"out_READ_"                                 +toString(j)+"_ACK",
324                                     dest, "in_GPR_READ_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_ACK");
325            COMPONENT_MAP(_component,src ,"out_READ_"                                 +toString(j)+"_DATA",
326                                     dest, "in_GPR_READ_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_DATA");
327
328            dest = _name;
329
330            PORT_MAP     (_component,src , "in_READ_"    +toString(j)+"_ADDRESS",
331                                     dest, "in_GPR_READ_"+toString(j)+"_NUM_REG");
332          }
333
334        for (uint32_t j=0; j<_param->_nb_gpr_write; j++)
335          {
336            dest = _name+"_glue";
337           
338#ifdef POSITION
339            _component->interface_map (src ,    "write_"+toString(j),
340                                       dest,"gpr_write_registerfile_"+toString(i)+"_"+toString(j));
341#endif
342
343            COMPONENT_MAP(_component,src , "in_WRITE_"                                 +toString(j)+"_VAL",
344                                     dest,"out_GPR_WRITE_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_VAL");
345            COMPONENT_MAP(_component,src ,"out_WRITE_"                                 +toString(j)+"_ACK",
346                                     dest, "in_GPR_WRITE_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_ACK");
347
348            dest = _name;
349
350            PORT_MAP     (_component,src , "in_WRITE_"    +toString(j)+"_ADDRESS",
351                                     dest, "in_GPR_WRITE_"+toString(j)+"_NUM_REG");
352            PORT_MAP     (_component,src , "in_WRITE_"    +toString(j)+"_DATA",
353                                     dest, "in_GPR_WRITE_"+toString(j)+"_DATA");
354          }
355
356      }// gpr
357   
358    {
359      for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
360        {
361          src = _name+"_gpr_status_"+toString(i);
362         
363          log_printf(INFO,Register_unit,FUNCTION,_("Instance : %s"),src.c_str());
364
365          {
366            dest = _name;
367#ifdef POSITION
368            _component->interface_map (src ,"",
369                                       dest,"");
370#endif
371            PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
372            PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
373          }
374         
375          for (uint32_t j=0; j<_param->_nb_gpr_read; j++)
376            {
377              dest = _name+"_glue";
378             
379#ifdef POSITION
380              _component->interface_map (src ,    "read_"+toString(j),
381                                         dest,"gpr_read_status_"+toString(i)+"_"+toString(j));
382#endif
383
384              COMPONENT_MAP(_component,src , "in_READ_"                           +toString(j)+"_VAL",
385                                       dest,"out_GPR_READ_STATUS_"+toString(i)+"_"+toString(j)+"_VAL");
386              COMPONENT_MAP(_component,src ,"out_READ_"                           +toString(j)+"_ACK",
387                                       dest, "in_GPR_READ_STATUS_"+toString(i)+"_"+toString(j)+"_ACK");
388              COMPONENT_MAP(_component,src ,"out_READ_"                           +toString(j)+"_DATA",
389                                       dest, "in_GPR_READ_STATUS_"+toString(i)+"_"+toString(j)+"_DATA_VAL");
390
391              dest = _name;
392             
393              PORT_MAP     (_component,src , "in_READ_"    +toString(j)+"_ADDRESS",
394                                       dest, "in_GPR_READ_"+toString(j)+"_NUM_REG");
395            }
396
397          uint32_t x=0;
398          for (uint32_t j=0; j<_param->_nb_gpr_write; j++)
399            {
400              dest = _name+"_glue";
401             
402#ifdef POSITION
403              _component->interface_map (src ,    "write_"+toString(j),
404                                         dest,"gpr_write_status_"+toString(i)+"_"+toString(j));
405#endif
406
407              COMPONENT_MAP(_component,src , "in_WRITE_"                           +toString(x)+"_VAL",
408                                       dest,"out_GPR_WRITE_STATUS_"+toString(i)+"_"+toString(j)+"_VAL");
409              COMPONENT_MAP(_component,src ,"out_WRITE_"                           +toString(x)+"_ACK",
410                                       dest, "in_GPR_WRITE_STATUS_"+toString(i)+"_"+toString(j)+"_ACK");
411              COMPONENT_MAP(_component,src , "in_WRITE_"                           +toString(x)+"_DATA",
412                                       dest,"out_GPR_WRITE_STATUS_"+toString(i)+"_"+toString(j)+"_DATA");
413//                                     dest,"out_CONST_1");
414             
415              dest = _name;
416             
417              PORT_MAP     (_component,src , "in_WRITE_"    +toString(x)+"_ADDRESS",
418                                       dest, "in_GPR_WRITE_"+toString(j)+"_NUM_REG");
419
420              x++;
421            }
422         
423          for (uint32_t j=0; j<_param->_nb_inst_insert_rob [i]; j++)
424            {
425              dest = _name+"_glue";
426             
427#ifdef POSITION
428              _component->interface_map (src ,    "write_"+toString(j),
429                                         dest,"insert_rob_gpr_status_"+toString(i)+"_"+toString(j));
430#endif
431
432              COMPONENT_MAP(_component,src , "in_WRITE_"                                +toString(x)+"_VAL",
433                                       dest,"out_INSERT_ROB_GPR_STATUS_"+toString(i)+"_"+toString(j)+"_VAL");
434              COMPONENT_MAP(_component,src ,"out_WRITE_"                                +toString(x)+"_ACK",
435                                       dest, "in_INSERT_ROB_GPR_STATUS_"+toString(i)+"_"+toString(j)+"_ACK");
436              COMPONENT_MAP(_component,src , "in_WRITE_"                                +toString(x)+"_DATA",
437                                       dest,"out_INSERT_ROB_GPR_STATUS_"+toString(i)+"_"+toString(j)+"_DATA");
438//                                     dest,"out_CONST_0");
439             
440              dest = _name;
441             
442              PORT_MAP     (_component,src , "in_WRITE_"                     +toString(x)+"_ADDRESS",
443                                       dest, "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_RD_NUM_REG");
444
445              x++;
446            }
447
448        }
449    }// gpr_status
450
451    for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
452      {
453        src = _name+"_spr_"+toString(i);
454       
455        log_printf(INFO,Register_unit,FUNCTION,_("Instance : %s"),src.c_str());
456       
457        {
458          dest = _name;
459#ifdef POSITION
460          _component->interface_map (src ,"",
461                                     dest,"");
462#endif
463          PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
464          PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
465        }
466
467        for (uint32_t j=0; j<_param->_nb_spr_read; j++)
468          {
469            dest = _name+"_glue";
470           
471#ifdef POSITION
472            _component->interface_map (src ,    "read_"+toString(j),
473                                       dest,"spr_read_registerfile_"+toString(i)+"_"+toString(j));
474#endif
475
476            COMPONENT_MAP(_component,src , "in_READ_"                                 +toString(j)+"_VAL",
477                                     dest,"out_SPR_READ_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_VAL");
478            COMPONENT_MAP(_component,src ,"out_READ_"                                 +toString(j)+"_ACK",
479                                     dest, "in_SPR_READ_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_ACK");
480            COMPONENT_MAP(_component,src ,"out_READ_"                                 +toString(j)+"_DATA",
481                                     dest, "in_SPR_READ_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_DATA");
482
483            dest = _name;
484
485            PORT_MAP     (_component,src , "in_READ_"    +toString(j)+"_ADDRESS",
486                                     dest, "in_SPR_READ_"+toString(j)+"_NUM_REG");
487          }
488
489        for (uint32_t j=0; j<_param->_nb_spr_write; j++)
490          {
491            dest = _name+"_glue";
492           
493#ifdef POSITION
494            _component->interface_map (src ,    "write_"+toString(j),
495                                       dest,"spr_write_registerfile_"+toString(i)+"_"+toString(j));
496#endif
497
498            COMPONENT_MAP(_component,src , "in_WRITE_"                                 +toString(j)+"_VAL",
499                                     dest,"out_SPR_WRITE_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_VAL");
500            COMPONENT_MAP(_component,src ,"out_WRITE_"                                 +toString(j)+"_ACK",
501                                     dest, "in_SPR_WRITE_REGISTERFILE_"+toString(i)+"_"+toString(j)+"_ACK");
502
503            dest = _name;
504
505            PORT_MAP     (_component,src , "in_WRITE_"    +toString(j)+"_ADDRESS",
506                                     dest, "in_SPR_WRITE_"+toString(j)+"_NUM_REG");
507            PORT_MAP     (_component,src , "in_WRITE_"    +toString(j)+"_DATA",
508                                     dest, "in_SPR_WRITE_"+toString(j)+"_DATA");
509          }
510
511      }// spr
512   
513    {
514      for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
515        {
516          src = _name+"_spr_status_"+toString(i);
517         
518          log_printf(INFO,Register_unit,FUNCTION,_("Instance : %s"),src.c_str());       
519 
520          {
521            dest = _name;
522#ifdef POSITION
523            _component->interface_map (src ,"",
524                                       dest,"");
525#endif
526            PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
527            PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
528          }
529
530          for (uint32_t j=0; j<_param->_nb_spr_read; j++)
531            {
532              dest = _name+"_glue";
533             
534#ifdef POSITION
535              _component->interface_map (src ,    "read_"+toString(j),
536                                         dest,"spr_read_status_"+toString(i)+"_"+toString(j));
537#endif
538
539              COMPONENT_MAP(_component,src , "in_READ_"                           +toString(j)+"_VAL",
540                                       dest,"out_SPR_READ_STATUS_"+toString(i)+"_"+toString(j)+"_VAL");
541              COMPONENT_MAP(_component,src ,"out_READ_"                           +toString(j)+"_ACK",
542                                       dest, "in_SPR_READ_STATUS_"+toString(i)+"_"+toString(j)+"_ACK");
543              COMPONENT_MAP(_component,src ,"out_READ_"                           +toString(j)+"_DATA",
544                                       dest, "in_SPR_READ_STATUS_"+toString(i)+"_"+toString(j)+"_DATA_VAL");
545
546              dest = _name;
547             
548              PORT_MAP     (_component,src , "in_READ_"    +toString(j)+"_ADDRESS",
549                                       dest, "in_SPR_READ_"+toString(j)+"_NUM_REG");
550            }
551
552          uint32_t x=0;
553          for (uint32_t j=0; j<_param->_nb_spr_write; j++)
554            {
555              dest = _name+"_glue";
556             
557#ifdef POSITION
558              _component->interface_map (src ,    "write_"+toString(j),
559                                         dest,"spr_write_status_"+toString(i)+"_"+toString(j));
560#endif
561
562              COMPONENT_MAP(_component,src , "in_WRITE_"                           +toString(x)+"_VAL",
563                                       dest,"out_SPR_WRITE_STATUS_"+toString(i)+"_"+toString(j)+"_VAL");
564              COMPONENT_MAP(_component,src ,"out_WRITE_"                           +toString(x)+"_ACK",
565                                       dest, "in_SPR_WRITE_STATUS_"+toString(i)+"_"+toString(j)+"_ACK");
566              COMPONENT_MAP(_component,src , "in_WRITE_"                           +toString(x)+"_DATA",
567                                       dest,"out_SPR_WRITE_STATUS_"+toString(i)+"_"+toString(j)+"_DATA");
568//                                     dest,"out_CONST_1");
569             
570              dest = _name;
571             
572              PORT_MAP     (_component,src , "in_WRITE_"    +toString(x)+"_ADDRESS",
573                                       dest, "in_SPR_WRITE_"+toString(j)+"_NUM_REG");
574
575              x++;
576            }
577         
578          for (uint32_t j=0; j<_param->_nb_inst_insert_rob [i]; j++)
579            {
580              dest = _name+"_glue";
581             
582#ifdef POSITION
583              _component->interface_map (src ,    "write_"+toString(j),
584                                         dest,"insert_rob_spr_status_"+toString(i)+"_"+toString(j));
585#endif
586
587              COMPONENT_MAP(_component,src , "in_WRITE_"                                +toString(x)+"_VAL",
588                                       dest,"out_INSERT_ROB_SPR_STATUS_"+toString(i)+"_"+toString(j)+"_VAL");
589              COMPONENT_MAP(_component,src ,"out_WRITE_"                                +toString(x)+"_ACK",
590                                       dest, "in_INSERT_ROB_SPR_STATUS_"+toString(i)+"_"+toString(j)+"_ACK");
591              COMPONENT_MAP(_component,src , "in_WRITE_"                                +toString(x)+"_DATA",
592                                       dest,"out_INSERT_ROB_SPR_STATUS_"+toString(i)+"_"+toString(j)+"_DATA");
593//                                     dest,"out_CONST_0");
594             
595              dest = _name;
596             
597              PORT_MAP     (_component,src , "in_WRITE_"                     +toString(x)+"_ADDRESS",
598                                       dest, "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_RE_NUM_REG");
599
600              x++;
601            }
602
603
604        }
605    }// spr_status
606
607    {
608      src = _name+"_glue";
609     
610      log_printf(INFO,Register_unit,FUNCTION,_("Instance : %s"),src.c_str()); 
611   
612        {
613          dest = _name;
614#ifdef POSITION
615          _component->interface_map (src ,"",
616                                     dest,"");
617#endif
618          PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
619          PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
620        }
621
622      for (uint32_t j=0; j<_param->_nb_gpr_read; j++)
623        {
624          dest = _name;
625             
626#ifdef POSITION
627          _component->interface_map (src ,"gpr_read_"+toString(j),
628                                     dest,"gpr_read_"+toString(j));
629#endif
630
631          PORT_MAP(_component,src , "in_GPR_READ_"+toString(j)+"_VAL",
632                              dest, "in_GPR_READ_"+toString(j)+"_VAL");
633          PORT_MAP(_component,src ,"out_GPR_READ_"+toString(j)+"_ACK",
634                              dest,"out_GPR_READ_"+toString(j)+"_ACK");
635          if (_param->_have_port_ooo_engine_id == true)
636          PORT_MAP(_component,src , "in_GPR_READ_"+toString(j)+"_OOO_ENGINE_ID",
637                              dest, "in_GPR_READ_"+toString(j)+"_OOO_ENGINE_ID");
638          PORT_MAP(_component,src ,"out_GPR_READ_"+toString(j)+"_DATA",
639                              dest,"out_GPR_READ_"+toString(j)+"_DATA");
640          PORT_MAP(_component,src ,"out_GPR_READ_"+toString(j)+"_DATA_VAL",
641                              dest,"out_GPR_READ_"+toString(j)+"_DATA_VAL");
642
643          // out_GPR_READ_REGISTERFILE_VAL   - gpr. in_READ_VAL
644          //  in_GPR_READ_REGISTERFILE_ACK   - gpr.out_READ_ACK
645          //  in_GPR_READ_REGISTERFILE_DATA  - gpr.out_READ_DATA
646         
647          // out_GPR_READ_STATUS_VAL         - gpr. in_READ_VAL
648          //  in_GPR_READ_STATUS_ACK         - gpr.out_READ_ACK
649          //  in_GPR_READ_STATUS_DATA_VAL    - gpr.out_READ_DATA
650        }
651
652      for (uint32_t j=0; j<_param->_nb_gpr_write; j++)
653        {
654          dest = _name;
655
656#ifdef POSITION
657          _component->interface_map (src ,"gpr_write_"+toString(j),
658                                     dest,"gpr_write_"+toString(j));
659#endif
660
661          PORT_MAP(_component,src , "in_GPR_WRITE_"+toString(j)+"_VAL",
662                              dest, "in_GPR_WRITE_"+toString(j)+"_VAL");
663          PORT_MAP(_component,src ,"out_GPR_WRITE_"+toString(j)+"_ACK",
664                              dest,"out_GPR_WRITE_"+toString(j)+"_ACK");
665          if (_param->_have_port_ooo_engine_id == true)
666          PORT_MAP(_component,src , "in_GPR_WRITE_"+toString(j)+"_OOO_ENGINE_ID",
667                              dest, "in_GPR_WRITE_"+toString(j)+"_OOO_ENGINE_ID");
668
669          // out_GPR_WRITE_REGISTERFILE_VAL - gpr. in_WRITE_VAL
670          //  in_GPR_WRITE_REGISTERFILE_ACK - gpr.out_WRITE_ACK
671          // out_GPR_WRITE_STATUS_VAL       - gpr. in_WRITE_VAL
672          //  in_GPR_WRITE_STATUS_ACK       - gpr.out_WRITE_ACK
673          // out_GPR_WRITE_STATUS_DATA      - gpr. in_WRITE_DATA
674        }
675
676      for (uint32_t j=0; j<_param->_nb_spr_read; j++)
677        {
678          dest = _name;
679             
680#ifdef POSITION
681          _component->interface_map (src ,"spr_read_"+toString(j),
682                                     dest,"spr_read_"+toString(j));
683#endif
684
685          PORT_MAP(_component,src , "in_SPR_READ_"+toString(j)+"_VAL",
686                              dest, "in_SPR_READ_"+toString(j)+"_VAL");
687          PORT_MAP(_component,src ,"out_SPR_READ_"+toString(j)+"_ACK",
688                              dest,"out_SPR_READ_"+toString(j)+"_ACK");
689          if (_param->_have_port_ooo_engine_id == true)
690          PORT_MAP(_component,src , "in_SPR_READ_"+toString(j)+"_OOO_ENGINE_ID",
691                              dest, "in_SPR_READ_"+toString(j)+"_OOO_ENGINE_ID");
692          PORT_MAP(_component,src ,"out_SPR_READ_"+toString(j)+"_DATA",
693                              dest,"out_SPR_READ_"+toString(j)+"_DATA");
694          PORT_MAP(_component,src ,"out_SPR_READ_"+toString(j)+"_DATA_VAL",
695                              dest,"out_SPR_READ_"+toString(j)+"_DATA_VAL");
696
697          // out_SPR_READ_REGISTERFILE_VAL   - spr. in_READ_VAL
698          //  in_SPR_READ_REGISTERFILE_ACK   - spr.out_READ_ACK
699          //  in_SPR_READ_REGISTERFILE_DATA  - spr.out_READ_DATA
700         
701          // out_SPR_READ_STATUS_VAL         - spr. in_READ_VAL
702          //  in_SPR_READ_STATUS_ACK         - spr.out_READ_ACK
703          //  in_SPR_READ_STATUS_DATA_VAL    - spr.out_READ_DATA
704        }
705
706      for (uint32_t j=0; j<_param->_nb_spr_write; j++)
707        {
708          dest = _name;
709
710#ifdef POSITION
711          _component->interface_map (src ,"spr_write_"+toString(j),
712                                     dest,"spr_write_"+toString(j));
713#endif
714
715          PORT_MAP(_component,src , "in_SPR_WRITE_"+toString(j)+"_VAL",
716                              dest, "in_SPR_WRITE_"+toString(j)+"_VAL");
717          PORT_MAP(_component,src ,"out_SPR_WRITE_"+toString(j)+"_ACK",
718                              dest,"out_SPR_WRITE_"+toString(j)+"_ACK");
719          if (_param->_have_port_ooo_engine_id == true)
720          PORT_MAP(_component,src , "in_SPR_WRITE_"+toString(j)+"_OOO_ENGINE_ID",
721                              dest, "in_SPR_WRITE_"+toString(j)+"_OOO_ENGINE_ID");
722
723          // out_SPR_WRITE_REGISTERFILE_VAL - spr. in_WRITE_VAL
724          //  in_SPR_WRITE_REGISTERFILE_ACK - spr.out_WRITE_ACK
725          // out_SPR_WRITE_STATUS_VAL       - spr. in_WRITE_VAL
726          //  in_SPR_WRITE_STATUS_ACK       - spr.out_WRITE_ACK
727          // out_SPR_WRITE_STATUS_DATA      - spr. in_WRITE_DATA
728        }
729
730      for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
731        {
732          uint32_t x     =_param->_nb_inst_insert_rob [i];
733
734          for (uint32_t j=0; j<x; j++)
735            {
736              dest = _name;
737
738#ifdef POSITION
739              _component->interface_map (src ,"insert_rob_"+toString(i)+"_"+toString(j),
740                                         dest,"insert_rob_"+toString(i)+"_"+toString(j));
741#endif
742
743              PORT_MAP(_component,src , "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_VAL",
744                                  dest, "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_VAL");
745              PORT_MAP(_component,src ,"out_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_ACK",
746                                  dest,"out_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_ACK");
747              PORT_MAP(_component,src , "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_RD_USE",
748                                  dest, "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_RD_USE");
749              PORT_MAP(_component,src , "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_RE_USE",
750                                  dest, "in_INSERT_ROB_"+toString(i)+"_"+toString(j)+"_RE_USE");
751             
752              // out_INSERT_ROB_GPR_STATUS_VAL - gpr_status.  in_WRITE_VAL
753              //  in_INSERT_ROB_GPR_STATUS_ACK - gpr_status. out_WRITE_ACK
754              // out_INSERT_ROB_GPR_STATUS_DATA- gpr_status.  in_WRITE_DATA
755              // out_INSERT_ROB_SPR_STATUS_VAL - spr_status.  in_WRITE_VAL
756              //  in_INSERT_ROB_SPR_STATUS_ACK - spr_status. out_WRITE_ACK
757              //  in_INSERT_ROB_SPR_STATUS_DATA- spr_status. out_WRITE_DATA
758            }
759        }
760     
761    }// glue
762
763#if DEBUG_Register_unit == true
764    _component->test_map ();
765#endif
766
767#ifdef POSITION
768    if (usage_is_set(_usage,USE_POSITION))
769      _component->generate_file();
770#endif
771
772//     std::cout << *_component << std::endl;
773
774    log_printf(FUNC,Register_unit,FUNCTION,"End");
775  };
776
777}; // end namespace register_unit
778}; // end namespace execute_loop
779}; // end namespace multi_execute_loop
780}; // end namespace core
781
782}; // end namespace behavioural
783}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.