source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit_allocation.cpp @ 76

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

Add new component : Read_unit (no tested)
Change functionnal_unit : now use type and operation to execute the good function
Change New_Component's script

File size: 33.8 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/include/Read_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace multi_read_unit {
17namespace read_unit {
18
19
20
21#undef  FUNCTION
22#define FUNCTION "Read_unit::allocation"
23  void Read_unit::allocation (
24#ifdef STATISTICS
25                               morpheo::behavioural::Parameters_Statistics * param_statistics
26#else
27                               void
28#endif
29                               )
30  {
31    log_printf(FUNC,Read_unit,FUNCTION,"Begin");
32
33    _component   = new Component (_usage);
34
35    Entity * entity = _component->set_entity (_name       
36                                              ,"Read_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    // ~~~~~[ Interface "read_unit_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58     {
59       ALLOC_INTERFACE("read_unit_in", IN, WEST, "Enter of new operation");
60
61       ALLOC_VAL_IN    ( in_READ_UNIT_IN_VAL);
62       ALLOC_ACK_OUT   (out_READ_UNIT_IN_ACK);
63       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_CONTEXT_ID           ,"context_id"           ,Tcontext_t        ,_param->_size_context_id   );
64       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_FRONT_END_ID         ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id );
65       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_OOO_ENGINE_ID        ,"ooo_engine_id"        ,Tcontext_t        ,_param->_size_ooo_engine_id);
66       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_packet_id    );
67       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_OPERATION            ,"operation"            ,Toperation_t      ,_param->_size_operation    );
68       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type         );
69       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue  );
70       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue   );
71       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1);
72       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_IMMEDIAT             ,"immediat"             ,Tgeneral_data_t   ,_param->_size_general_data);
73       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_READ_RA              ,"read_ra"              ,Tcontrol_t        ,1);
74       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_NUM_REG_RA           ,"num_reg_ra"           ,Tgeneral_address_t,_param->_size_general_register);
75       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_READ_RB              ,"read_rb"              ,Tcontrol_t        ,1);
76       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_NUM_REG_RB           ,"num_reg_rb"           ,Tgeneral_address_t,_param->_size_general_register);
77       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_READ_RC              ,"read_rc"              ,Tcontrol_t        ,1);
78       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_NUM_REG_RC           ,"num_reg_rc"           ,Tspecial_address_t,_param->_size_special_register);
79       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_WRITE_RD             ,"write_rd"             ,Tcontrol_t        ,1);
80       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_NUM_REG_RD           ,"num_reg_rd"           ,Tgeneral_address_t,_param->_size_general_register);
81       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_WRITE_RE             ,"write_re"             ,Tcontrol_t        ,1);
82       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_NUM_REG_RE           ,"num_reg_re"           ,Tspecial_address_t,_param->_size_special_register);
83     }
84
85    // ~~~~~[ Interface "read_unit_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86     {
87       ALLOC1_INTERFACE("read_unit_out", OUT, EAST, "Output of operation. All operand is valid.", _param->_nb_inst_retire);
88
89       ALLOC1_VAL_OUT   (out_READ_UNIT_OUT_VAL);
90       ALLOC1_ACK_IN    ( in_READ_UNIT_OUT_ACK);
91       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_CONTEXT_ID           ,"context_id"           ,Tcontext_t        ,_param->_size_context_id      );
92       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_FRONT_END_ID         ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id    );
93       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_OOO_ENGINE_ID        ,"ooo_engine_id"        ,Tcontext_t        ,_param->_size_ooo_engine_id   );
94       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_packet_id       );
95       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_OPERATION            ,"operation"            ,Toperation_t      ,_param->_size_operation       );
96       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
97       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue     );
98       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue      );
99       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
100       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_IMMEDIAT             ,"immediat"             ,Tgeneral_data_t   ,_param->_size_general_data    );
101       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_DATA_RA              ,"data_ra"              ,Tgeneral_data_t   ,_param->_size_general_data    );
102       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_DATA_RB              ,"data_rb"              ,Tgeneral_data_t   ,_param->_size_general_data    );
103       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_DATA_RC              ,"data_rc"              ,Tspecial_data_t   ,_param->_size_special_data    );
104       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_WRITE_RD             ,"write_rd"             ,Tcontrol_t        ,1                             );
105       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_NUM_REG_RD           ,"num_reg_rd"           ,Tgeneral_address_t,_param->_size_general_register);
106       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_WRITE_RE             ,"write_re"             ,Tcontrol_t        ,1                             );
107       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_NUM_REG_RE           ,"num_reg_re"           ,Tspecial_address_t,_param->_size_special_register);
108     }
109
110    // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111     {
112       ALLOC1_INTERFACE("gpr_read", OUT, SOUTH, "Read port.", _param->_nb_gpr_read);
113
114       ALLOC1_VAL_OUT   (out_GPR_READ_VAL);
115       ALLOC1_ACK_IN    ( in_GPR_READ_ACK);
116       ALLOC1_SIGNAL_OUT(out_GPR_READ_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
117       ALLOC1_SIGNAL_OUT(out_GPR_READ_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_general_data    );
118       ALLOC1_SIGNAL_IN ( in_GPR_READ_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_register);
119       ALLOC1_SIGNAL_IN ( in_GPR_READ_DATA_VAL     ,"data_val"     ,Tcontrol_t        ,1);
120     }
121
122    // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123     {
124       ALLOC1_INTERFACE("spr_read", OUT, SOUTH, "Read port.", _param->_nb_spr_read);
125
126       ALLOC1_VAL_OUT   (out_SPR_READ_VAL);
127       ALLOC1_ACK_IN    ( in_SPR_READ_ACK);
128       ALLOC1_SIGNAL_OUT(out_SPR_READ_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
129       ALLOC1_SIGNAL_OUT(out_SPR_READ_NUM_REG      ,"num_reg"      ,Tspecial_address_t,_param->_size_special_data    );
130       ALLOC1_SIGNAL_IN ( in_SPR_READ_DATA         ,"data"         ,Tspecial_data_t   ,_param->_size_special_register);
131       ALLOC1_SIGNAL_IN ( in_SPR_READ_DATA_VAL     ,"data_val"     ,Tcontrol_t        ,1);
132     }
133
134    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135     {
136       ALLOC1_INTERFACE("gpr_write", IN , SOUTH, "Write port.", _param->_nb_gpr_write);
137
138       ALLOC1_VAL_IN    ( in_GPR_WRITE_VAL);
139       ALLOC1_SIGNAL_IN ( in_GPR_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
140       ALLOC1_SIGNAL_IN ( in_GPR_WRITE_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_general_data    );
141       ALLOC1_SIGNAL_IN ( in_GPR_WRITE_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_register);
142     }
143
144    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145     {
146       ALLOC1_INTERFACE("spr_write", IN , SOUTH, "Write port.", _param->_nb_spr_write);
147
148       ALLOC1_VAL_IN    ( in_SPR_WRITE_VAL);
149       ALLOC1_SIGNAL_IN ( in_SPR_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
150       ALLOC1_SIGNAL_IN ( in_SPR_WRITE_NUM_REG      ,"num_reg"      ,Tspecial_address_t,_param->_size_special_data    );
151       ALLOC1_SIGNAL_IN ( in_SPR_WRITE_DATA         ,"data"         ,Tspecial_data_t   ,_param->_size_special_register);
152     }
153
154    // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155     {
156       ALLOC1_INTERFACE("bypass_write", IN , NORTH, "Output of write_queue.", _param->_nb_bypass_write);
157
158       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
159       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_GPR_VAL      ,"gpr_val"      ,Tcontrol_t        ,1);
160       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_GPR_NUM_REG  ,"gpr_num_reg"  ,Tgeneral_address_t,_param->_size_general_data    );
161       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_GPR_DATA     ,"gpr_data"     ,Tgeneral_data_t   ,_param->_size_general_register);
162       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_SPR_VAL      ,"spr_val"      ,Tcontrol_t        ,1);
163       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_SPR_NUM_REG  ,"spr_num_reg"  ,Tspecial_address_t,_param->_size_special_data    );
164       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_SPR_DATA     ,"spr_data"     ,Tspecial_data_t   ,_param->_size_special_register);
165     }
166
167    // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168     {
169       ALLOC1_INTERFACE("bypass_memory", IN , NORTH, "Output of write_queue.", _param->_nb_bypass_memory);
170
171       ALLOC1_SIGNAL_IN ( in_BYPASS_MEMORY_VAL          ,"val"          ,Tcontrol_t        ,1);
172       ALLOC1_SIGNAL_IN ( in_BYPASS_MEMORY_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
173       ALLOC1_SIGNAL_IN ( in_BYPASS_MEMORY_NUM_REG      ,"num_reg"      ,Tgeneral_address_t,_param->_size_general_data    );
174       ALLOC1_SIGNAL_IN ( in_BYPASS_MEMORY_DATA         ,"data"         ,Tgeneral_data_t   ,_param->_size_general_register);
175     }
176
177    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
178
179    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
180
181     std::string name;
182
183     {
184       name = _name+"_read_queue";
185       
186       _component_read_queue  = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue::Read_queue (name.c_str()
187#ifdef STATISTICS
188                                                                                                                                                      ,param_statistics
189#endif
190                                                                                                                                                      ,_param->_param_read_queue);
191       
192       _component->set_component (_component_read_queue->_component
193#ifdef POSITION
194                                  , 50, 50, 10, 10
195#endif
196                                  );
197     }
198     {
199       name = _name+"_reservation_station";
200       
201       _component_reservation_station  = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Reservation_station (name.c_str()
202#ifdef STATISTICS
203                                                                                                                                                                                 ,param_statistics
204#endif
205                                                                                                                                                                                 ,_param->_param_reservation_station);
206       
207       _component->set_component (_component_reservation_station->_component
208#ifdef POSITION
209                                  , 50, 50, 10, 10
210#endif
211                                  );
212     }
213
214    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
215     {
216       name = _name+"_read_queue";
217       std::cout << "Instance : " << name << std::endl;
218       
219       {
220#ifdef POSITION
221         _component->interface_map (name ,"",
222                                    _name,"");
223#endif
224
225         _component->port_map(name,"in_CLOCK" , _name, "in_CLOCK");
226         _component->port_map(name,"in_NRESET", _name, "in_NRESET");
227       }
228
229       // ~~~~~[ Interface "read_queue_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230       {
231         std::string dest = _name;
232#ifdef POSITION
233         _component->interface_map (name,"read_queue_in",
234                                    dest,"read_unit_in");
235#endif
236
237         _component->port_map(name, "in_READ_QUEUE_IN_VAL"                  ,dest, "in_READ_UNIT_IN_VAL"                  );
238         _component->port_map(name,"out_READ_QUEUE_IN_ACK"                  ,dest,"out_READ_UNIT_IN_ACK"                  );
239         if (_param->_have_port_context_id)
240         _component->port_map(name, "in_READ_QUEUE_IN_CONTEXT_ID"           ,dest, "in_READ_UNIT_IN_CONTEXT_ID"           );
241         if (_param->_have_port_front_end_id)
242         _component->port_map(name, "in_READ_QUEUE_IN_FRONT_END_ID"         ,dest, "in_READ_UNIT_IN_FRONT_END_ID"         );
243         if (_param->_have_port_ooo_engine_id)
244         _component->port_map(name, "in_READ_QUEUE_IN_OOO_ENGINE_ID"        ,dest, "in_READ_UNIT_IN_OOO_ENGINE_ID"        );
245         if (_param->_have_port_packet_id)
246         _component->port_map(name, "in_READ_QUEUE_IN_ROB_ID"               ,dest, "in_READ_UNIT_IN_PACKET_ID"            );
247         _component->port_map(name, "in_READ_QUEUE_IN_OPERATION"            ,dest, "in_READ_UNIT_IN_OPERATION"            );
248         _component->port_map(name, "in_READ_QUEUE_IN_TYPE"                 ,dest, "in_READ_UNIT_IN_TYPE"                 );
249         _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE",dest, "in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE");
250         _component->port_map(name, "in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE" ,dest, "in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE" );
251         _component->port_map(name, "in_READ_QUEUE_IN_HAS_IMMEDIAT"         ,dest, "in_READ_UNIT_IN_HAS_IMMEDIAT"         );
252         _component->port_map(name, "in_READ_QUEUE_IN_IMMEDIAT"             ,dest, "in_READ_UNIT_IN_IMMEDIAT"             );
253         _component->port_map(name, "in_READ_QUEUE_IN_READ_RA"              ,dest, "in_READ_UNIT_IN_READ_RA"              );
254         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RA"           ,dest, "in_READ_UNIT_IN_NUM_REG_RA"           );
255         _component->port_map(name, "in_READ_QUEUE_IN_READ_RB"              ,dest, "in_READ_UNIT_IN_READ_RB"              );
256         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RB"           ,dest, "in_READ_UNIT_IN_NUM_REG_RB"           );
257         _component->port_map(name, "in_READ_QUEUE_IN_READ_RC"              ,dest, "in_READ_UNIT_IN_READ_RC"              );
258         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RC"           ,dest, "in_READ_UNIT_IN_NUM_REG_RC"           );
259         _component->port_map(name, "in_READ_QUEUE_IN_WRITE_RD"             ,dest, "in_READ_UNIT_IN_WRITE_RD"             );
260         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RD"           ,dest, "in_READ_UNIT_IN_NUM_REG_RD"           );
261         _component->port_map(name, "in_READ_QUEUE_IN_WRITE_RE"             ,dest, "in_READ_UNIT_IN_WRITE_RE"             );
262         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RE"           ,dest, "in_READ_UNIT_IN_NUM_REG_RE"           );
263       }
264       // ~~~~~[ Interface "read_queue_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
265       {
266         std::string dest = _name+"_reservation_station";
267         
268#ifdef POSITION
269         _component->interface_map (name,"read_queue_in",
270                                    dest,"insert");
271#endif
272
273         _component->port_map(name,"out_READ_QUEUE_OUT_VAL"                  ,dest, "in_INSERT_VAL"                  );
274         _component->port_map(name, "in_READ_QUEUE_OUT_ACK"                  ,dest,"out_INSERT_ACK"                  );
275         if (_param->_have_port_context_id)
276         _component->port_map(name,"out_READ_QUEUE_OUT_CONTEXT_ID"           ,dest, "in_INSERT_CONTEXT_ID"           );
277         if (_param->_have_port_front_end_id)
278         _component->port_map(name,"out_READ_QUEUE_OUT_FRONT_END_ID"         ,dest, "in_INSERT_FRONT_END_ID"         );
279         if (_param->_have_port_ooo_engine_id)
280         _component->port_map(name,"out_READ_QUEUE_OUT_OOO_ENGINE_ID"        ,dest, "in_INSERT_OOO_ENGINE_ID"        );
281         if (_param->_have_port_packet_id)
282         _component->port_map(name,"out_READ_QUEUE_OUT_ROB_ID"               ,dest, "in_INSERT_ROB_ID"               );
283         _component->port_map(name,"out_READ_QUEUE_OUT_OPERATION"            ,dest, "in_INSERT_OPERATION"            );
284         _component->port_map(name,"out_READ_QUEUE_OUT_TYPE"                 ,dest, "in_INSERT_TYPE"                 );
285         _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE",dest, "in_INSERT_STORE_QUEUE_PTR_WRITE");
286         _component->port_map(name,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" ,dest, "in_INSERT_LOAD_QUEUE_PTR_WRITE" );
287         _component->port_map(name,"out_READ_QUEUE_OUT_HAS_IMMEDIAT"         ,dest, "in_INSERT_HAS_IMMEDIAT"         );
288         _component->port_map(name,"out_READ_QUEUE_OUT_IMMEDIAT"             ,dest, "in_INSERT_IMMEDIAT"             );
289//       _component->port_map(name,"out_READ_QUEUE_OUT_READ_RA"              ,dest, "in_INSERT_READ_RA"              );
290         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RA"           ,dest, "in_INSERT_NUM_REG_RA"           );
291         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RA_VAL"          ,dest, "in_INSERT_DATA_RA_VAL"          );
292         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RA"              ,dest, "in_INSERT_DATA_RA"              );
293//       _component->port_map(name,"out_READ_QUEUE_OUT_READ_RB"              ,dest, "in_INSERT_READ_RB"              );
294         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RB"           ,dest, "in_INSERT_NUM_REG_RB"           );
295         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RB_VAL"          ,dest, "in_INSERT_DATA_RB_VAL"          );
296         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RB"              ,dest, "in_INSERT_DATA_RB"              );
297//       _component->port_map(name,"out_READ_QUEUE_OUT_READ_RC"              ,dest, "in_INSERT_READ_RC"              );
298         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RC"           ,dest, "in_INSERT_NUM_REG_RC"           );
299         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RC_VAL"          ,dest, "in_INSERT_DATA_RC_VAL"          );
300         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RC"              ,dest, "in_INSERT_DATA_RC"              );
301         _component->port_map(name,"out_READ_QUEUE_OUT_WRITE_RD"             ,dest, "in_INSERT_WRITE_RD"             );
302         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RD"           ,dest, "in_INSERT_NUM_REG_RD"           );
303         _component->port_map(name,"out_READ_QUEUE_OUT_WRITE_RE"             ,dest, "in_INSERT_WRITE_RE"             );
304         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RE"           ,dest, "in_INSERT_NUM_REG_RE"           );
305       }
306       // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307       for (uint32_t i=0; i<_param->_nb_gpr_read; i++)
308         {
309           std::string dest = _name;
310#ifdef POSITION
311           _component->interface_map (name,"gpr_read_"+toString(i),
312                                      dest,"gpr_read_"+toString(i));
313#endif
314
315           _component->port_map(name,"out_GPR_READ_"+toString(i)+"_VAL"          ,dest,"out_GPR_READ_"+toString(i)+"_VAL"          );
316           _component->port_map(name, "in_GPR_READ_"+toString(i)+"_ACK"          ,dest, "in_GPR_READ_"+toString(i)+"_ACK"          );
317           if (_param->_have_port_ooo_engine_id)
318           _component->port_map(name,"out_GPR_READ_"+toString(i)+"_OOO_ENGINE_ID",dest,"out_GPR_READ_"+toString(i)+"_OOO_ENGINE_ID");
319           _component->port_map(name,"out_GPR_READ_"+toString(i)+"_NUM_REG"      ,dest,"out_GPR_READ_"+toString(i)+"_NUM_REG"      );
320           _component->port_map(name, "in_GPR_READ_"+toString(i)+"_DATA"         ,dest, "in_GPR_READ_"+toString(i)+"_DATA"         );
321           _component->port_map(name, "in_GPR_READ_"+toString(i)+"_DATA_VAL"     ,dest, "in_GPR_READ_"+toString(i)+"_DATA_VAL"     );
322         }
323
324       // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325       for (uint32_t i=0; i<_param->_nb_spr_read; i++)
326         {
327           std::string dest = _name;
328#ifdef POSITION
329           _component->interface_map (name,"spr_read_"+toString(i),
330                                      dest,"spr_read_"+toString(i));
331#endif
332
333           _component->port_map(name,"out_SPR_READ_"+toString(i)+"_VAL"          ,dest,"out_SPR_READ_"+toString(i)+"_VAL"          );
334           _component->port_map(name, "in_SPR_READ_"+toString(i)+"_ACK"          ,dest, "in_SPR_READ_"+toString(i)+"_ACK"          );
335           if (_param->_have_port_ooo_engine_id)
336           _component->port_map(name,"out_SPR_READ_"+toString(i)+"_OOO_ENGINE_ID",dest,"out_SPR_READ_"+toString(i)+"_OOO_ENGINE_ID");
337           _component->port_map(name,"out_SPR_READ_"+toString(i)+"_NUM_REG"      ,dest,"out_SPR_READ_"+toString(i)+"_NUM_REG"      );
338           _component->port_map(name, "in_SPR_READ_"+toString(i)+"_DATA"         ,dest, "in_SPR_READ_"+toString(i)+"_DATA"         );
339           _component->port_map(name, "in_SPR_READ_"+toString(i)+"_DATA_VAL"     ,dest, "in_SPR_READ_"+toString(i)+"_DATA_VAL"     );
340         }
341
342       // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343       for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
344         {
345           std::string dest = _name;
346#ifdef POSITION
347           _component->interface_map (name,"gpr_write_"+toString(i),
348                                      dest,"gpr_write_"+toString(i));
349#endif
350           
351           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_GPR_WRITE_"+toString(i)+"_VAL"          );
352           if (_param->_have_port_ooo_engine_id)
353           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
354           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      );
355           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_GPR_WRITE_"+toString(i)+"_DATA"         );
356         }
357       // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358       for (uint32_t i=0; i<_param->_nb_spr_write; i++)
359         {
360           std::string dest = _name;
361#ifdef POSITION
362           _component->interface_map (name,"spr_write_"+toString(i),
363                                      dest,"spr_write_"+toString(i));
364#endif
365           
366           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_SPR_WRITE_"+toString(i)+"_VAL"          );
367           if (_param->_have_port_ooo_engine_id)
368           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
369           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      );
370           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_SPR_WRITE_"+toString(i)+"_DATA"         );
371         }
372     }
373
374     {
375       name = _name+"_reservation_station";
376       std::cout << "Instance : " << name << std::endl;
377       
378       {
379#ifdef POSITION
380         _component->interface_map (name ,"",
381                                    _name,"");
382#endif
383
384         _component->port_map(name,"in_CLOCK" , _name, "in_CLOCK");
385         _component->port_map(name,"in_NRESET", _name, "in_NRESET");
386       }
387
388       // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
389       {
390         std::string dest = _name+"_read_queue";
391         
392#ifdef POSITION
393         _component->interface_map (name,"insert",
394                                    dest,"read_queue_in");
395#endif
396
397         _component->port_map(name, "in_INSERT_VAL"                  ,dest,"out_READ_QUEUE_OUT_VAL"                  );
398         _component->port_map(name,"out_INSERT_ACK"                  ,dest, "in_READ_QUEUE_OUT_ACK"                  );
399         if (_param->_have_port_context_id)
400         _component->port_map(name, "in_INSERT_CONTEXT_ID"           ,dest,"out_READ_QUEUE_OUT_CONTEXT_ID"           );
401         if (_param->_have_port_front_end_id)
402         _component->port_map(name, "in_INSERT_FRONT_END_ID"         ,dest,"out_READ_QUEUE_OUT_FRONT_END_ID"         );
403         if (_param->_have_port_ooo_engine_id)
404         _component->port_map(name, "in_INSERT_OOO_ENGINE_ID"        ,dest,"out_READ_QUEUE_OUT_OOO_ENGINE_ID"        );
405         if (_param->_have_port_packet_id)
406         _component->port_map(name, "in_INSERT_ROB_ID"               ,dest,"out_READ_QUEUE_OUT_ROB_ID"               );
407         _component->port_map(name, "in_INSERT_OPERATION"            ,dest,"out_READ_QUEUE_OUT_OPERATION"            );
408         _component->port_map(name, "in_INSERT_TYPE"                 ,dest,"out_READ_QUEUE_OUT_TYPE"                 );
409         _component->port_map(name, "in_INSERT_STORE_QUEUE_PTR_WRITE",dest,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE");
410         _component->port_map(name, "in_INSERT_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" );
411         _component->port_map(name, "in_INSERT_HAS_IMMEDIAT"         ,dest,"out_READ_QUEUE_OUT_HAS_IMMEDIAT"         );
412         _component->port_map(name, "in_INSERT_IMMEDIAT"             ,dest,"out_READ_QUEUE_OUT_IMMEDIAT"             );
413//       _component->port_map(name, "in_INSERT_READ_RA"              ,dest,"out_READ_QUEUE_OUT_READ_RA"              );
414         _component->port_map(name, "in_INSERT_NUM_REG_RA"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RA"           );
415         _component->port_map(name, "in_INSERT_DATA_RA_VAL"          ,dest,"out_READ_QUEUE_OUT_DATA_RA_VAL"          );
416         _component->port_map(name, "in_INSERT_DATA_RA"              ,dest,"out_READ_QUEUE_OUT_DATA_RA"              );
417//       _component->port_map(name, "in_INSERT_READ_RB"              ,dest,"out_READ_QUEUE_OUT_READ_RB"              );
418         _component->port_map(name, "in_INSERT_NUM_REG_RB"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RB"           );
419         _component->port_map(name, "in_INSERT_DATA_RB_VAL"          ,dest,"out_READ_QUEUE_OUT_DATA_RB_VAL"          );
420         _component->port_map(name, "in_INSERT_DATA_RB"              ,dest,"out_READ_QUEUE_OUT_DATA_RB"              );
421//       _component->port_map(name, "in_INSERT_READ_RC"              ,dest,"out_READ_QUEUE_OUT_READ_RC"              );
422         _component->port_map(name, "in_INSERT_NUM_REG_RC"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RC"           );
423         _component->port_map(name, "in_INSERT_DATA_RC_VAL"          ,dest,"out_READ_QUEUE_OUT_DATA_RC_VAL"          );
424         _component->port_map(name, "in_INSERT_DATA_RC"              ,dest,"out_READ_QUEUE_OUT_DATA_RC"              );
425         _component->port_map(name, "in_INSERT_WRITE_RD"             ,dest,"out_READ_QUEUE_OUT_WRITE_RD"             );
426         _component->port_map(name, "in_INSERT_NUM_REG_RD"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RD"           );
427         _component->port_map(name, "in_INSERT_WRITE_RE"             ,dest,"out_READ_QUEUE_OUT_WRITE_RE"             );
428         _component->port_map(name, "in_INSERT_NUM_REG_RE"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RE"           );
429       }
430
431       // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
432       for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
433         {
434           std::string dest = _name;
435           
436#ifdef POSITION
437           _component->interface_map (name,"retire_"+toString(i),
438                                      dest,"read_unit_out_"+toString(i));
439#endif
440           
441           _component->port_map(name,"out_RETIRE_"+toString(i)+"_VAL"                  ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_VAL"                  );
442           _component->port_map(name, "in_RETIRE_"+toString(i)+"_ACK"                  ,dest, "in_READ_UNIT_OUT_"+toString(i)+"_ACK"                  );
443           if (_param->_have_port_context_id)
444           _component->port_map(name,"out_RETIRE_"+toString(i)+"_CONTEXT_ID"           ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_CONTEXT_ID"           );
445           if (_param->_have_port_front_end_id)
446           _component->port_map(name,"out_RETIRE_"+toString(i)+"_FRONT_END_ID"         ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_FRONT_END_ID"         );
447           if (_param->_have_port_ooo_engine_id)
448           _component->port_map(name,"out_RETIRE_"+toString(i)+"_OOO_ENGINE_ID"        ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_OOO_ENGINE_ID"        );
449           if (_param->_have_port_packet_id)
450           _component->port_map(name,"out_RETIRE_"+toString(i)+"_ROB_ID"               ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_PACKET_ID"            );
451           _component->port_map(name,"out_RETIRE_"+toString(i)+"_OPERATION"            ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_OPERATION"            );
452           _component->port_map(name,"out_RETIRE_"+toString(i)+"_TYPE"                 ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_TYPE"                 );
453           _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE");
454           _component->port_map(name,"out_RETIRE_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" );
455           _component->port_map(name,"out_RETIRE_"+toString(i)+"_HAS_IMMEDIAT"         ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_HAS_IMMEDIAT"         );
456           _component->port_map(name,"out_RETIRE_"+toString(i)+"_IMMEDIAT"             ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_IMMEDIAT"             );
457           _component->port_map(name,"out_RETIRE_"+toString(i)+"_DATA_RA"              ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_DATA_RA"              );
458           _component->port_map(name,"out_RETIRE_"+toString(i)+"_DATA_RB"              ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_DATA_RB"              );
459           _component->port_map(name,"out_RETIRE_"+toString(i)+"_DATA_RC"              ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_DATA_RC"              );
460           _component->port_map(name,"out_RETIRE_"+toString(i)+"_WRITE_RD"             ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_WRITE_RD"             );
461           _component->port_map(name,"out_RETIRE_"+toString(i)+"_NUM_REG_RD"           ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_NUM_REG_RD"           );
462           _component->port_map(name,"out_RETIRE_"+toString(i)+"_WRITE_RE"             ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_WRITE_RE"             );
463           _component->port_map(name,"out_RETIRE_"+toString(i)+"_NUM_REG_RE"           ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_NUM_REG_RE"           );
464         }
465
466       // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
467       for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
468         {
469           std::string dest = _name;
470#ifdef POSITION
471           _component->interface_map (name,"gpr_write_"+toString(i),
472                                      dest,"gpr_write_"+toString(i));
473#endif
474           
475           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_GPR_WRITE_"+toString(i)+"_VAL"          );
476           if (_param->_have_port_ooo_engine_id)
477           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
478           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      );
479           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_GPR_WRITE_"+toString(i)+"_DATA"         );
480         }
481       // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
482       for (uint32_t i=0; i<_param->_nb_spr_write; i++)
483         {
484           std::string dest = _name;
485#ifdef POSITION
486           _component->interface_map (name,"spr_write_"+toString(i),
487                                      dest,"spr_write_"+toString(i));
488#endif
489           
490           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_SPR_WRITE_"+toString(i)+"_VAL"          );
491           if (_param->_have_port_ooo_engine_id)
492           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
493           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      );
494           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_SPR_WRITE_"+toString(i)+"_DATA"         );
495         }
496       // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
497       for (uint32_t i=0; i<_param->_nb_bypass_write; i++)
498         {
499           std::string dest = _name;
500#ifdef POSITION
501           _component->interface_map (name,"bypass_write_"+toString(i),
502                                      dest,"bypass_write_"+toString(i));
503#endif
504           
505           if (_param->_have_port_ooo_engine_id)
506           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_BYPASS_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
507           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_GPR_VAL"      ,dest, "in_BYPASS_WRITE_"+toString(i)+"_GPR_VAL"      );
508           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_GPR_NUM_REG"  ,dest, "in_BYPASS_WRITE_"+toString(i)+"_GPR_NUM_REG"  );
509           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_GPR_DATA"     ,dest, "in_BYPASS_WRITE_"+toString(i)+"_GPR_DATA"     );
510           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_SPR_VAL"      ,dest, "in_BYPASS_WRITE_"+toString(i)+"_SPR_VAL"      );
511           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_SPR_NUM_REG"  ,dest, "in_BYPASS_WRITE_"+toString(i)+"_SPR_NUM_REG"  );
512           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_SPR_DATA"     ,dest, "in_BYPASS_WRITE_"+toString(i)+"_SPR_DATA"     );
513         }
514       // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
515       for (uint32_t i=0; i<_param->_nb_bypass_memory; i++)
516         {
517           std::string dest = _name;
518#ifdef POSITION
519           _component->interface_map (name,"bypass_memory_"+toString(i),
520                                      dest,"bypass_memory_"+toString(i));
521#endif
522           
523           if (_param->_have_port_ooo_engine_id)
524           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_BYPASS_MEMORY_"+toString(i)+"_OOO_ENGINE_ID");
525           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_VAL"          ,dest, "in_BYPASS_MEMORY_"+toString(i)+"_VAL"          );
526           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_NUM_REG"      ,dest, "in_BYPASS_MEMORY_"+toString(i)+"_NUM_REG"      );
527           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_DATA"         ,dest, "in_BYPASS_MEMORY_"+toString(i)+"_DATA"         );
528         }       
529     }
530
531#ifdef POSITION
532    _component->generate_file();
533#endif
534
535    log_printf(FUNC,Read_unit,FUNCTION,"End");
536  };
537
538}; // end namespace read_unit
539}; // end namespace multi_read_unit
540}; // end namespace execute_loop
541}; // end namespace multi_execute_loop
542}; // end namespace core
543
544}; // end namespace behavioural
545}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.