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

Last change on this file since 82 was 82, checked in by rosiere, 16 years ago
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
  • Property svn:keywords set to Id
File size: 34.0 KB
Line 
1/*
2 * $Id: Read_unit_allocation.cpp 82 2008-05-01 16:48:45Z rosiere $
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_VALACK_IN    ( in_READ_UNIT_IN_VAL,VAL);
62       ALLOC_VALACK_OUT   (out_READ_UNIT_IN_ACK,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        ,log2(_param->_size_store_queue));
70       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,log2(_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_VALACK_OUT   (out_READ_UNIT_OUT_VAL,VAL);
90       ALLOC1_VALACK_IN    ( in_READ_UNIT_OUT_ACK,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        ,log2(_param->_size_store_queue));
98       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,log2(_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_VALACK_OUT   (out_GPR_READ_VAL,VAL);
115       ALLOC1_VALACK_IN    ( in_GPR_READ_ACK,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_VALACK_OUT   (out_SPR_READ_VAL,VAL);
127       ALLOC1_VALACK_IN    ( in_SPR_READ_ACK,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_VALACK_IN    ( in_GPR_WRITE_VAL,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_VALACK_IN    ( in_SPR_WRITE_VAL,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
187         (name.c_str()
188#ifdef STATISTICS
189          ,param_statistics
190#endif
191          ,_param->_param_read_queue
192          ,_usage);
193       
194       _component->set_component (_component_read_queue->_component
195#ifdef POSITION
196                                  , 50, 50, 10, 10
197#endif
198                                  );
199     }
200     {
201       name = _name+"_reservation_station";
202       
203       _component_reservation_station  = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Reservation_station
204         (name.c_str()
205#ifdef STATISTICS
206          ,param_statistics
207#endif
208          ,_param->_param_reservation_station
209          ,_usage);
210       
211       _component->set_component (_component_reservation_station->_component
212#ifdef POSITION
213                                  , 50, 50, 10, 10
214#endif
215                                  );
216     }
217
218    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
219     {
220       name = _name+"_read_queue";
221       std::cout << "Instance : " << name << std::endl;
222       {
223#ifdef POSITION
224         _component->interface_map (name ,"",
225                                    _name,"");
226#endif
227
228         _component->port_map(name,"in_CLOCK" , _name, "in_CLOCK");
229         _component->port_map(name,"in_NRESET", _name, "in_NRESET");
230       }
231
232       // ~~~~~[ Interface "read_queue_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233       {
234         std::string dest = _name;
235#ifdef POSITION
236         _component->interface_map (name,"read_queue_in",
237                                    dest,"read_unit_in");
238#endif
239
240         _component->port_map(name, "in_READ_QUEUE_IN_VAL"                  ,dest, "in_READ_UNIT_IN_VAL"                  );
241         _component->port_map(name,"out_READ_QUEUE_IN_ACK"                  ,dest,"out_READ_UNIT_IN_ACK"                  );
242         if (_param->_have_port_context_id)
243         _component->port_map(name, "in_READ_QUEUE_IN_CONTEXT_ID"           ,dest, "in_READ_UNIT_IN_CONTEXT_ID"           );
244         if (_param->_have_port_front_end_id)
245         _component->port_map(name, "in_READ_QUEUE_IN_FRONT_END_ID"         ,dest, "in_READ_UNIT_IN_FRONT_END_ID"         );
246         if (_param->_have_port_ooo_engine_id)
247         _component->port_map(name, "in_READ_QUEUE_IN_OOO_ENGINE_ID"        ,dest, "in_READ_UNIT_IN_OOO_ENGINE_ID"        );
248         if (_param->_have_port_packet_id)
249         _component->port_map(name, "in_READ_QUEUE_IN_ROB_ID"               ,dest, "in_READ_UNIT_IN_PACKET_ID"            );
250         _component->port_map(name, "in_READ_QUEUE_IN_OPERATION"            ,dest, "in_READ_UNIT_IN_OPERATION"            );
251         _component->port_map(name, "in_READ_QUEUE_IN_TYPE"                 ,dest, "in_READ_UNIT_IN_TYPE"                 );
252         _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE",dest, "in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE");
253         if (_param->_have_port_load_queue_ptr)
254         _component->port_map(name, "in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE" ,dest, "in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE" );
255         _component->port_map(name, "in_READ_QUEUE_IN_HAS_IMMEDIAT"         ,dest, "in_READ_UNIT_IN_HAS_IMMEDIAT"         );
256         _component->port_map(name, "in_READ_QUEUE_IN_IMMEDIAT"             ,dest, "in_READ_UNIT_IN_IMMEDIAT"             );
257         _component->port_map(name, "in_READ_QUEUE_IN_READ_RA"              ,dest, "in_READ_UNIT_IN_READ_RA"              );
258         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RA"           ,dest, "in_READ_UNIT_IN_NUM_REG_RA"           );
259         _component->port_map(name, "in_READ_QUEUE_IN_READ_RB"              ,dest, "in_READ_UNIT_IN_READ_RB"              );
260         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RB"           ,dest, "in_READ_UNIT_IN_NUM_REG_RB"           );
261         _component->port_map(name, "in_READ_QUEUE_IN_READ_RC"              ,dest, "in_READ_UNIT_IN_READ_RC"              );
262         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RC"           ,dest, "in_READ_UNIT_IN_NUM_REG_RC"           );
263         _component->port_map(name, "in_READ_QUEUE_IN_WRITE_RD"             ,dest, "in_READ_UNIT_IN_WRITE_RD"             );
264         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RD"           ,dest, "in_READ_UNIT_IN_NUM_REG_RD"           );
265         _component->port_map(name, "in_READ_QUEUE_IN_WRITE_RE"             ,dest, "in_READ_UNIT_IN_WRITE_RE"             );
266         _component->port_map(name, "in_READ_QUEUE_IN_NUM_REG_RE"           ,dest, "in_READ_UNIT_IN_NUM_REG_RE"           );
267       }
268       // ~~~~~[ Interface "read_queue_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269       {
270         std::string dest = _name+"_reservation_station";
271         
272#ifdef POSITION
273         _component->interface_map (name,"read_queue_in",
274                                    dest,"insert");
275#endif
276
277         _component->port_map(name,"out_READ_QUEUE_OUT_VAL"                  ,dest, "in_INSERT_VAL"                  );
278         _component->port_map(name, "in_READ_QUEUE_OUT_ACK"                  ,dest,"out_INSERT_ACK"                  );
279         if (_param->_have_port_context_id)
280         _component->port_map(name,"out_READ_QUEUE_OUT_CONTEXT_ID"           ,dest, "in_INSERT_CONTEXT_ID"           );
281         if (_param->_have_port_front_end_id)
282         _component->port_map(name,"out_READ_QUEUE_OUT_FRONT_END_ID"         ,dest, "in_INSERT_FRONT_END_ID"         );
283         if (_param->_have_port_ooo_engine_id)
284         _component->port_map(name,"out_READ_QUEUE_OUT_OOO_ENGINE_ID"        ,dest, "in_INSERT_OOO_ENGINE_ID"        );
285         if (_param->_have_port_packet_id)
286         _component->port_map(name,"out_READ_QUEUE_OUT_ROB_ID"               ,dest, "in_INSERT_ROB_ID"               );
287         _component->port_map(name,"out_READ_QUEUE_OUT_OPERATION"            ,dest, "in_INSERT_OPERATION"            );
288         _component->port_map(name,"out_READ_QUEUE_OUT_TYPE"                 ,dest, "in_INSERT_TYPE"                 );
289         _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE",dest, "in_INSERT_STORE_QUEUE_PTR_WRITE");
290         if (_param->_have_port_load_queue_ptr)
291         _component->port_map(name,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" ,dest, "in_INSERT_LOAD_QUEUE_PTR_WRITE" );
292         _component->port_map(name,"out_READ_QUEUE_OUT_HAS_IMMEDIAT"         ,dest, "in_INSERT_HAS_IMMEDIAT"         );
293         _component->port_map(name,"out_READ_QUEUE_OUT_IMMEDIAT"             ,dest, "in_INSERT_IMMEDIAT"             );
294//       _component->port_map(name,"out_READ_QUEUE_OUT_READ_RA"              ,dest, "in_INSERT_READ_RA"              );
295         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RA"           ,dest, "in_INSERT_NUM_REG_RA"           );
296         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RA_VAL"          ,dest, "in_INSERT_DATA_RA_VAL"          );
297         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RA"              ,dest, "in_INSERT_DATA_RA"              );
298//       _component->port_map(name,"out_READ_QUEUE_OUT_READ_RB"              ,dest, "in_INSERT_READ_RB"              );
299         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RB"           ,dest, "in_INSERT_NUM_REG_RB"           );
300         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RB_VAL"          ,dest, "in_INSERT_DATA_RB_VAL"          );
301         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RB"              ,dest, "in_INSERT_DATA_RB"              );
302//       _component->port_map(name,"out_READ_QUEUE_OUT_READ_RC"              ,dest, "in_INSERT_READ_RC"              );
303         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RC"           ,dest, "in_INSERT_NUM_REG_RC"           );
304         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RC_VAL"          ,dest, "in_INSERT_DATA_RC_VAL"          );
305         _component->port_map(name,"out_READ_QUEUE_OUT_DATA_RC"              ,dest, "in_INSERT_DATA_RC"              );
306         _component->port_map(name,"out_READ_QUEUE_OUT_WRITE_RD"             ,dest, "in_INSERT_WRITE_RD"             );
307         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RD"           ,dest, "in_INSERT_NUM_REG_RD"           );
308         _component->port_map(name,"out_READ_QUEUE_OUT_WRITE_RE"             ,dest, "in_INSERT_WRITE_RE"             );
309         _component->port_map(name,"out_READ_QUEUE_OUT_NUM_REG_RE"           ,dest, "in_INSERT_NUM_REG_RE"           );
310       }
311       // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
312       for (uint32_t i=0; i<_param->_nb_gpr_read; i++)
313         {
314           std::string dest = _name;
315#ifdef POSITION
316           _component->interface_map (name,"gpr_read_"+toString(i),
317                                      dest,"gpr_read_"+toString(i));
318#endif
319
320           _component->port_map(name,"out_GPR_READ_"+toString(i)+"_VAL"          ,dest,"out_GPR_READ_"+toString(i)+"_VAL"          );
321           _component->port_map(name, "in_GPR_READ_"+toString(i)+"_ACK"          ,dest, "in_GPR_READ_"+toString(i)+"_ACK"          );
322           if (_param->_have_port_ooo_engine_id)
323           _component->port_map(name,"out_GPR_READ_"+toString(i)+"_OOO_ENGINE_ID",dest,"out_GPR_READ_"+toString(i)+"_OOO_ENGINE_ID");
324           _component->port_map(name,"out_GPR_READ_"+toString(i)+"_NUM_REG"      ,dest,"out_GPR_READ_"+toString(i)+"_NUM_REG"      );
325           _component->port_map(name, "in_GPR_READ_"+toString(i)+"_DATA"         ,dest, "in_GPR_READ_"+toString(i)+"_DATA"         );
326           _component->port_map(name, "in_GPR_READ_"+toString(i)+"_DATA_VAL"     ,dest, "in_GPR_READ_"+toString(i)+"_DATA_VAL"     );
327         }
328
329       // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
330       for (uint32_t i=0; i<_param->_nb_spr_read; i++)
331         {
332           std::string dest = _name;
333#ifdef POSITION
334           _component->interface_map (name,"spr_read_"+toString(i),
335                                      dest,"spr_read_"+toString(i));
336#endif
337
338           _component->port_map(name,"out_SPR_READ_"+toString(i)+"_VAL"          ,dest,"out_SPR_READ_"+toString(i)+"_VAL"          );
339           _component->port_map(name, "in_SPR_READ_"+toString(i)+"_ACK"          ,dest, "in_SPR_READ_"+toString(i)+"_ACK"          );
340           if (_param->_have_port_ooo_engine_id)
341           _component->port_map(name,"out_SPR_READ_"+toString(i)+"_OOO_ENGINE_ID",dest,"out_SPR_READ_"+toString(i)+"_OOO_ENGINE_ID");
342           _component->port_map(name,"out_SPR_READ_"+toString(i)+"_NUM_REG"      ,dest,"out_SPR_READ_"+toString(i)+"_NUM_REG"      );
343           _component->port_map(name, "in_SPR_READ_"+toString(i)+"_DATA"         ,dest, "in_SPR_READ_"+toString(i)+"_DATA"         );
344           _component->port_map(name, "in_SPR_READ_"+toString(i)+"_DATA_VAL"     ,dest, "in_SPR_READ_"+toString(i)+"_DATA_VAL"     );
345         }
346
347       // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348       for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
349         {
350           std::string dest = _name;
351#ifdef POSITION
352           _component->interface_map (name,"gpr_write_"+toString(i),
353                                      dest,"gpr_write_"+toString(i));
354#endif
355           
356           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_GPR_WRITE_"+toString(i)+"_VAL"          );
357           if (_param->_have_port_ooo_engine_id)
358           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
359           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      );
360           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_GPR_WRITE_"+toString(i)+"_DATA"         );
361         }
362       // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
363       for (uint32_t i=0; i<_param->_nb_spr_write; i++)
364         {
365           std::string dest = _name;
366#ifdef POSITION
367           _component->interface_map (name,"spr_write_"+toString(i),
368                                      dest,"spr_write_"+toString(i));
369#endif
370           
371           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_SPR_WRITE_"+toString(i)+"_VAL"          );
372           if (_param->_have_port_ooo_engine_id)
373           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
374           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      );
375           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_SPR_WRITE_"+toString(i)+"_DATA"         );
376         }
377     }
378
379     {
380       name = _name+"_reservation_station";
381       std::cout << "Instance : " << name << std::endl;
382       {
383#ifdef POSITION
384         _component->interface_map (name ,"",
385                                    _name,"");
386#endif
387
388         _component->port_map(name,"in_CLOCK" , _name, "in_CLOCK");
389         _component->port_map(name,"in_NRESET", _name, "in_NRESET");
390       }
391
392       // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
393       {
394         std::string dest = _name+"_read_queue";
395         
396#ifdef POSITION
397         _component->interface_map (name,"insert",
398                                    dest,"read_queue_in");
399#endif
400
401         _component->port_map(name, "in_INSERT_VAL"                  ,dest,"out_READ_QUEUE_OUT_VAL"                  );
402         _component->port_map(name,"out_INSERT_ACK"                  ,dest, "in_READ_QUEUE_OUT_ACK"                  );
403         if (_param->_have_port_context_id)
404         _component->port_map(name, "in_INSERT_CONTEXT_ID"           ,dest,"out_READ_QUEUE_OUT_CONTEXT_ID"           );
405         if (_param->_have_port_front_end_id)
406         _component->port_map(name, "in_INSERT_FRONT_END_ID"         ,dest,"out_READ_QUEUE_OUT_FRONT_END_ID"         );
407         if (_param->_have_port_ooo_engine_id)
408         _component->port_map(name, "in_INSERT_OOO_ENGINE_ID"        ,dest,"out_READ_QUEUE_OUT_OOO_ENGINE_ID"        );
409         if (_param->_have_port_packet_id)
410         _component->port_map(name, "in_INSERT_ROB_ID"               ,dest,"out_READ_QUEUE_OUT_ROB_ID"               );
411         _component->port_map(name, "in_INSERT_OPERATION"            ,dest,"out_READ_QUEUE_OUT_OPERATION"            );
412         _component->port_map(name, "in_INSERT_TYPE"                 ,dest,"out_READ_QUEUE_OUT_TYPE"                 );
413         _component->port_map(name, "in_INSERT_STORE_QUEUE_PTR_WRITE",dest,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE");
414         if (_param->_have_port_load_queue_ptr)
415         _component->port_map(name, "in_INSERT_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" );
416         _component->port_map(name, "in_INSERT_HAS_IMMEDIAT"         ,dest,"out_READ_QUEUE_OUT_HAS_IMMEDIAT"         );
417         _component->port_map(name, "in_INSERT_IMMEDIAT"             ,dest,"out_READ_QUEUE_OUT_IMMEDIAT"             );
418//       _component->port_map(name, "in_INSERT_READ_RA"              ,dest,"out_READ_QUEUE_OUT_READ_RA"              );
419         _component->port_map(name, "in_INSERT_NUM_REG_RA"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RA"           );
420         _component->port_map(name, "in_INSERT_DATA_RA_VAL"          ,dest,"out_READ_QUEUE_OUT_DATA_RA_VAL"          );
421         _component->port_map(name, "in_INSERT_DATA_RA"              ,dest,"out_READ_QUEUE_OUT_DATA_RA"              );
422//       _component->port_map(name, "in_INSERT_READ_RB"              ,dest,"out_READ_QUEUE_OUT_READ_RB"              );
423         _component->port_map(name, "in_INSERT_NUM_REG_RB"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RB"           );
424         _component->port_map(name, "in_INSERT_DATA_RB_VAL"          ,dest,"out_READ_QUEUE_OUT_DATA_RB_VAL"          );
425         _component->port_map(name, "in_INSERT_DATA_RB"              ,dest,"out_READ_QUEUE_OUT_DATA_RB"              );
426//       _component->port_map(name, "in_INSERT_READ_RC"              ,dest,"out_READ_QUEUE_OUT_READ_RC"              );
427         _component->port_map(name, "in_INSERT_NUM_REG_RC"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RC"           );
428         _component->port_map(name, "in_INSERT_DATA_RC_VAL"          ,dest,"out_READ_QUEUE_OUT_DATA_RC_VAL"          );
429         _component->port_map(name, "in_INSERT_DATA_RC"              ,dest,"out_READ_QUEUE_OUT_DATA_RC"              );
430         _component->port_map(name, "in_INSERT_WRITE_RD"             ,dest,"out_READ_QUEUE_OUT_WRITE_RD"             );
431         _component->port_map(name, "in_INSERT_NUM_REG_RD"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RD"           );
432         _component->port_map(name, "in_INSERT_WRITE_RE"             ,dest,"out_READ_QUEUE_OUT_WRITE_RE"             );
433         _component->port_map(name, "in_INSERT_NUM_REG_RE"           ,dest,"out_READ_QUEUE_OUT_NUM_REG_RE"           );
434       }
435
436       // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
437       for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
438         {
439           std::string dest = _name;
440           
441#ifdef POSITION
442           _component->interface_map (name,"retire_"+toString(i),
443                                      dest,"read_unit_out_"+toString(i));
444#endif
445           
446           _component->port_map(name,"out_RETIRE_"+toString(i)+"_VAL"                  ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_VAL"                  );
447           _component->port_map(name, "in_RETIRE_"+toString(i)+"_ACK"                  ,dest, "in_READ_UNIT_OUT_"+toString(i)+"_ACK"                  );
448           if (_param->_have_port_context_id)
449           _component->port_map(name,"out_RETIRE_"+toString(i)+"_CONTEXT_ID"           ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_CONTEXT_ID"           );
450           if (_param->_have_port_front_end_id)
451           _component->port_map(name,"out_RETIRE_"+toString(i)+"_FRONT_END_ID"         ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_FRONT_END_ID"         );
452           if (_param->_have_port_ooo_engine_id)
453           _component->port_map(name,"out_RETIRE_"+toString(i)+"_OOO_ENGINE_ID"        ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_OOO_ENGINE_ID"        );
454           if (_param->_have_port_packet_id)
455           _component->port_map(name,"out_RETIRE_"+toString(i)+"_ROB_ID"               ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_PACKET_ID"            );
456           _component->port_map(name,"out_RETIRE_"+toString(i)+"_OPERATION"            ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_OPERATION"            );
457           _component->port_map(name,"out_RETIRE_"+toString(i)+"_TYPE"                 ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_TYPE"                 );
458           _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE");
459           if (_param->_have_port_load_queue_ptr)
460           _component->port_map(name,"out_RETIRE_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" );
461           _component->port_map(name,"out_RETIRE_"+toString(i)+"_HAS_IMMEDIAT"         ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_HAS_IMMEDIAT"         );
462           _component->port_map(name,"out_RETIRE_"+toString(i)+"_IMMEDIAT"             ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_IMMEDIAT"             );
463           _component->port_map(name,"out_RETIRE_"+toString(i)+"_DATA_RA"              ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_DATA_RA"              );
464           _component->port_map(name,"out_RETIRE_"+toString(i)+"_DATA_RB"              ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_DATA_RB"              );
465           _component->port_map(name,"out_RETIRE_"+toString(i)+"_DATA_RC"              ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_DATA_RC"              );
466           _component->port_map(name,"out_RETIRE_"+toString(i)+"_WRITE_RD"             ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_WRITE_RD"             );
467           _component->port_map(name,"out_RETIRE_"+toString(i)+"_NUM_REG_RD"           ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_NUM_REG_RD"           );
468           _component->port_map(name,"out_RETIRE_"+toString(i)+"_WRITE_RE"             ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_WRITE_RE"             );
469           _component->port_map(name,"out_RETIRE_"+toString(i)+"_NUM_REG_RE"           ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_NUM_REG_RE"           );
470         }
471
472       // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
473       for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
474         {
475           std::string dest = _name;
476#ifdef POSITION
477           _component->interface_map (name,"gpr_write_"+toString(i),
478                                      dest,"gpr_write_"+toString(i));
479#endif
480           
481           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_GPR_WRITE_"+toString(i)+"_VAL"          );
482           if (_param->_have_port_ooo_engine_id)
483           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_GPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
484           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_GPR_WRITE_"+toString(i)+"_NUM_REG"      );
485           _component->port_map(name, "in_GPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_GPR_WRITE_"+toString(i)+"_DATA"         );
486         }
487       // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
488       for (uint32_t i=0; i<_param->_nb_spr_write; i++)
489         {
490           std::string dest = _name;
491#ifdef POSITION
492           _component->interface_map (name,"spr_write_"+toString(i),
493                                      dest,"spr_write_"+toString(i));
494#endif
495           
496           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_VAL"          ,dest, "in_SPR_WRITE_"+toString(i)+"_VAL"          );
497           if (_param->_have_port_ooo_engine_id)
498           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_SPR_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
499           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      ,dest, "in_SPR_WRITE_"+toString(i)+"_NUM_REG"      );
500           _component->port_map(name, "in_SPR_WRITE_"+toString(i)+"_DATA"         ,dest, "in_SPR_WRITE_"+toString(i)+"_DATA"         );
501         }
502       // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503       for (uint32_t i=0; i<_param->_nb_bypass_write; i++)
504         {
505           std::string dest = _name;
506#ifdef POSITION
507           _component->interface_map (name,"bypass_write_"+toString(i),
508                                      dest,"bypass_write_"+toString(i));
509#endif
510           
511           if (_param->_have_port_ooo_engine_id)
512           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_BYPASS_WRITE_"+toString(i)+"_OOO_ENGINE_ID");
513           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_GPR_VAL"      ,dest, "in_BYPASS_WRITE_"+toString(i)+"_GPR_VAL"      );
514           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_GPR_NUM_REG"  ,dest, "in_BYPASS_WRITE_"+toString(i)+"_GPR_NUM_REG"  );
515           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_GPR_DATA"     ,dest, "in_BYPASS_WRITE_"+toString(i)+"_GPR_DATA"     );
516           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_SPR_VAL"      ,dest, "in_BYPASS_WRITE_"+toString(i)+"_SPR_VAL"      );
517           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_SPR_NUM_REG"  ,dest, "in_BYPASS_WRITE_"+toString(i)+"_SPR_NUM_REG"  );
518           _component->port_map(name, "in_BYPASS_WRITE_"+toString(i)+"_SPR_DATA"     ,dest, "in_BYPASS_WRITE_"+toString(i)+"_SPR_DATA"     );
519         }
520       // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521       for (uint32_t i=0; i<_param->_nb_bypass_memory; i++)
522         {
523           std::string dest = _name;
524#ifdef POSITION
525           _component->interface_map (name,"bypass_memory_"+toString(i),
526                                      dest,"bypass_memory_"+toString(i));
527#endif
528           
529           if (_param->_have_port_ooo_engine_id)
530           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_OOO_ENGINE_ID",dest, "in_BYPASS_MEMORY_"+toString(i)+"_OOO_ENGINE_ID");
531           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_VAL"          ,dest, "in_BYPASS_MEMORY_"+toString(i)+"_VAL"          );
532           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_NUM_REG"      ,dest, "in_BYPASS_MEMORY_"+toString(i)+"_NUM_REG"      );
533           _component->port_map(name, "in_BYPASS_MEMORY_"+toString(i)+"_DATA"         ,dest, "in_BYPASS_MEMORY_"+toString(i)+"_DATA"         );
534         }       
535     }
536     
537
538#ifdef POSITION
539    _component->generate_file();
540#endif
541
542    log_printf(FUNC,Read_unit,FUNCTION,"End");
543  };
544
545}; // end namespace read_unit
546}; // end namespace multi_read_unit
547}; // end namespace execute_loop
548}; // end namespace multi_execute_loop
549}; // end namespace core
550
551}; // end namespace behavioural
552}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.