source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue.cpp @ 122

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

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

  • Property svn:keywords set to Id
File size: 11.1 KB
Line 
1/*
2 * $Id: Core_Glue.cpp 122 2009-06-03 08:15:51Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Core_Glue/include/Core_Glue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace core_glue {
14
15
16#undef  FUNCTION
17#define FUNCTION "Core_Glue::Core_Glue"
18  Core_Glue::Core_Glue
19  (
20#ifdef SYSTEMC
21   sc_module_name name,
22#else
23   string name,
24#endif
25#ifdef STATISTICS
26   morpheo::behavioural::Parameters_Statistics * param_statistics,
27#endif
28   morpheo::behavioural::core::core_glue::Parameters * param,
29   morpheo::behavioural::Tusage_t usage
30   ):
31    _name              (name)
32    ,_param            (param)
33    ,_usage            (usage)
34  {
35    log_begin(Core_Glue,FUNCTION);
36
37    usage_environment(_usage);
38
39#if DEBUG_Core_Glue == true
40    log_printf(INFO,Core_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
41
42    std::cout << *param << std::endl;
43#endif   
44
45    log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Allocation"),_name.c_str());
46
47    allocation (
48#ifdef STATISTICS
49                param_statistics
50#endif
51                );
52
53#ifdef STATISTICS
54    if (usage_is_set(_usage,USE_STATISTICS))
55      { 
56        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
57
58        statistics_allocation(param_statistics);
59      }
60#endif
61
62#ifdef VHDL
63    if (usage_is_set(_usage,USE_VHDL))
64      {
65        // generate the vhdl
66        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
67       
68        vhdl();
69      }
70#endif
71
72#ifdef SYSTEMC
73    if (usage_is_set(_usage,USE_SYSTEMC))
74      {
75        // Constant
76        if (_param->_have_port_front_end_id)
77          for (uint32_t i=0; i<_param->_nb_front_end; ++i)
78            for (uint32_t j=0; j<_param->_nb_inst_decod [i]; ++j)
79              {
80                PORT_WRITE(out_RENAME_FRONT_END_ID [i][j],_param->_translate_num_front_end_to_ooo_engine_front_end_id[i]);
81              }
82
83        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
84
85        SC_METHOD (transition);
86        dont_initialize ();
87        sensitive << (*(in_CLOCK)).pos();
88       
89# ifdef SYSTEMCASS_SPECIFIC
90        // List dependency information
91# endif   
92
93//      log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());
94//      SC_METHOD (genMoore);
95//      dont_initialize ();
96//      sensitive << (*(in_CLOCK)).neg(); // need internal register
97
98// # ifdef SYSTEMCASS_SPECIFIC
99//      // List dependency information
100// # endif   
101
102        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - genMealy_branch_complete"),_name.c_str());
103        SC_METHOD (genMealy_branch_complete);
104        dont_initialize ();
105//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
106        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
107          for (uint32_t j=0; j<_param->_front_end_nb_inst_branch_complete[i]; ++j)
108            sensitive << (*(in_BRANCH_COMPLETE_FRONT_END_ACK             [i][j]))
109                      << (*(in_BRANCH_COMPLETE_FRONT_END_MISS_PREDICTION [i][j]));
110
111        for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
112          for (uint32_t j=0; j<_param->_ooo_engine_nb_inst_branch_complete[i]; ++j)
113            {
114              sensitive << (*(in_BRANCH_COMPLETE_OOO_ENGINE_VAL            [i][j]))
115                        << (*(in_BRANCH_COMPLETE_OOO_ENGINE_ADDRESS        [i][j]))
116                        << (*(in_BRANCH_COMPLETE_OOO_ENGINE_NO_SEQUENCE    [i][j]));
117              if (_param->_have_port_front_end_id)
118              sensitive << (*(in_BRANCH_COMPLETE_OOO_ENGINE_FRONT_END_ID   [i][j]));
119              if (_param->_have_port_context_id)
120              sensitive << (*(in_BRANCH_COMPLETE_OOO_ENGINE_CONTEXT_ID     [i][j]));
121              if (_param->_have_port_depth)
122              sensitive << (*(in_BRANCH_COMPLETE_OOO_ENGINE_DEPTH          [i][j]));
123            }   
124
125
126# ifdef SYSTEMCASS_SPECIFIC
127        // List dependency information
128# endif   
129
130        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - genMealy_commit_event"),_name.c_str());
131        SC_METHOD (genMealy_commit_event);
132        dont_initialize ();
133//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
134        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
135          sensitive << (*(in_COMMIT_EVENT_FRONT_END_ACK               [i]));
136        for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
137          {
138            sensitive << (*(in_COMMIT_EVENT_OOO_ENGINE_VAL              [i]))
139                      << (*(in_COMMIT_EVENT_OOO_ENGINE_TYPE             [i]))
140                      << (*(in_COMMIT_EVENT_OOO_ENGINE_IS_DELAY_SLOT    [i]))
141                      << (*(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS          [i]))
142                      << (*(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EPCR_VAL [i]))
143                      << (*(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EPCR     [i]))
144                      << (*(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EEAR_VAL [i]))
145                      << (*(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EEAR     [i]));
146            if (_param->_have_port_front_end_id)
147            sensitive << (*(in_COMMIT_EVENT_OOO_ENGINE_FRONT_END_ID     [i]));
148            if (_param->_have_port_context_id)
149            sensitive << (*(in_COMMIT_EVENT_OOO_ENGINE_CONTEXT_ID       [i]));
150            if (_param->_have_port_depth)
151            sensitive << (*(in_COMMIT_EVENT_OOO_ENGINE_DEPTH            [i]));
152          }
153
154# ifdef SYSTEMCASS_SPECIFIC
155        // List dependency information
156# endif   
157
158        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - genMealy_issue"),_name.c_str());
159        SC_METHOD (genMealy_issue);
160        dont_initialize ();
161//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
162
163        for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
164          for (uint32_t j=0; j<_param->_nb_inst_issue_queue [i]; ++j)
165            {
166              sensitive << (*(in_ISSUE_OOO_ENGINE_VAL                   [i][j]))
167                        << (*(in_ISSUE_OOO_ENGINE_TYPE                  [i][j]))
168                        << (*(in_ISSUE_OOO_ENGINE_OPERATION             [i][j]))
169                        << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [i][j]))
170                        << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ  [i][j]))
171                        << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY     [i][j]))
172                        << (*(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT          [i][j]))
173                        << (*(in_ISSUE_OOO_ENGINE_IMMEDIAT              [i][j]))
174                        << (*(in_ISSUE_OOO_ENGINE_READ_RA               [i][j]))
175                        << (*(in_ISSUE_OOO_ENGINE_NUM_REG_RA            [i][j]))
176                        << (*(in_ISSUE_OOO_ENGINE_READ_RB               [i][j]))
177                        << (*(in_ISSUE_OOO_ENGINE_NUM_REG_RB            [i][j]))
178                        << (*(in_ISSUE_OOO_ENGINE_READ_RC               [i][j]))
179                        << (*(in_ISSUE_OOO_ENGINE_NUM_REG_RC            [i][j]))
180                        << (*(in_ISSUE_OOO_ENGINE_WRITE_RD              [i][j]))
181                        << (*(in_ISSUE_OOO_ENGINE_NUM_REG_RD            [i][j]))
182                        << (*(in_ISSUE_OOO_ENGINE_WRITE_RE              [i][j]))
183                        << (*(in_ISSUE_OOO_ENGINE_NUM_REG_RE            [i][j]));
184              if (_param->_have_port_front_end_id)
185              sensitive << (*(in_ISSUE_OOO_ENGINE_FRONT_END_ID          [i][j]));
186              if (_param->_have_port_context_id)
187              sensitive << (*(in_ISSUE_OOO_ENGINE_CONTEXT_ID            [i][j]));
188              if (_param->_have_port_rob_ptr)
189              sensitive << (*(in_ISSUE_OOO_ENGINE_PACKET_ID             [i][j]));
190              if (_param->_have_port_load_queue_ptr)
191              sensitive << (*(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE  [i][j]));
192            }
193
194        for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
195          for (uint32_t j=0; j<_param->_nb_read_unit [i]; ++j)
196            sensitive << (*(in_ISSUE_EXECUTE_LOOP_ACK [i][j]));
197
198# ifdef SYSTEMCASS_SPECIFIC
199        // List dependency information
200# endif   
201
202        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - genMealy_execute"),_name.c_str());
203        SC_METHOD (genMealy_execute);
204        dont_initialize ();
205//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
206
207        for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
208          for (uint32_t j=0; j<_param->_ooo_engine_nb_execute_loop[i]; ++j)
209            for (uint32_t k=0; k<_param->_nb_inst_execute[i][j]; ++k)
210              sensitive << (*(in_EXECUTE_OOO_ENGINE_ACK [i][j][k]));
211       
212        for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
213          for (uint32_t j=0; j<_param->_nb_write_unit[i]; ++j)
214            {
215              sensitive << (*(in_EXECUTE_EXECUTE_LOOP_VAL           [i][j]))
216//                      << (*(in_EXECUTE_EXECUTE_LOOP_OPERATION     [i][j]))
217//                      << (*(in_EXECUTE_EXECUTE_LOOP_TYPE          [i][j]))
218                        << (*(in_EXECUTE_EXECUTE_LOOP_FLAGS         [i][j]))
219                        << (*(in_EXECUTE_EXECUTE_LOOP_EXCEPTION     [i][j]))
220                        << (*(in_EXECUTE_EXECUTE_LOOP_NO_SEQUENCE   [i][j]))
221                        << (*(in_EXECUTE_EXECUTE_LOOP_ADDRESS       [i][j]))
222                        << (*(in_EXECUTE_EXECUTE_LOOP_DATA          [i][j]));
223              if (_param->_have_port_context_id)
224              sensitive << (*(in_EXECUTE_EXECUTE_LOOP_CONTEXT_ID    [i][j]));
225              if (_param->_have_port_front_end_id)
226              sensitive << (*(in_EXECUTE_EXECUTE_LOOP_FRONT_END_ID  [i][j]));
227              if (_param->_have_port_ooo_engine_id)
228              sensitive << (*(in_EXECUTE_EXECUTE_LOOP_OOO_ENGINE_ID [i][j]));
229              if (_param->_have_port_rob_ptr)
230              sensitive << (*(in_EXECUTE_EXECUTE_LOOP_PACKET_ID     [i][j]));
231            }
232
233# ifdef SYSTEMCASS_SPECIFIC
234        // List dependency information
235# endif   
236
237        log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Method - genMealy_insert"),_name.c_str());
238        SC_METHOD (genMealy_insert);
239        dont_initialize ();
240//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
241
242        for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
243          for (uint32_t j=0; j<_param->_nb_inst_insert[i]; ++j)
244            sensitive << (*(in_INSERT_OOO_ENGINE_VAL        [i][j]))
245                      << (*(in_INSERT_OOO_ENGINE_RD_USE     [i][j]))
246                      << (*(in_INSERT_OOO_ENGINE_RD_NUM_REG [i][j]))
247                      << (*(in_INSERT_OOO_ENGINE_RE_USE     [i][j]))
248                      << (*(in_INSERT_OOO_ENGINE_RE_NUM_REG [i][j]));
249        for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
250          for (uint32_t j=0; j<_param->_execute_loop_nb_ooo_engine[i]; ++j)
251            for (uint32_t k=0; k<_param->_execute_loop_nb_inst_insert[i][j]; ++k)
252              sensitive << (*(in_INSERT_EXECUTE_LOOP_ACK [i][j][k]));
253
254# ifdef SYSTEMCASS_SPECIFIC
255        // List dependency information
256# endif   
257       
258#endif
259      }
260    log_end(Core_Glue,FUNCTION);
261  };
262   
263#undef  FUNCTION
264#define FUNCTION "Core_Glue::~Core_Glue"
265  Core_Glue::~Core_Glue (void)
266  {
267    log_begin(Core_Glue,FUNCTION);
268
269#ifdef STATISTICS
270    if (usage_is_set(_usage,USE_STATISTICS))
271      {
272        statistics_deallocation();
273      }
274#endif
275
276    log_printf(INFO,Core_Glue,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
277    deallocation ();
278
279    log_end(Core_Glue,FUNCTION);
280  };
281
282}; // end namespace core_glue
283}; // end namespace core
284
285}; // end namespace behavioural
286}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.