source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit.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: 7.4 KB
Line 
1/*
2 * $Id: Load_Store_pointer_unit.cpp 122 2009-06-03 08:15:51Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace rename_unit {
16namespace load_store_pointer_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Load_Store_pointer_unit::Load_Store_pointer_unit"
21  Load_Store_pointer_unit::Load_Store_pointer_unit
22  (
23#ifdef SYSTEMC
24   sc_module_name name,
25#else
26   string name,
27#endif
28#ifdef STATISTICS
29   morpheo::behavioural::Parameters_Statistics * param_statistics,
30#endif
31   morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::load_store_pointer_unit::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin");
39
40#if DEBUG_Load_Store_pointer_unit == true
41    log_printf(INFO,Load_Store_pointer_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
42
43    std::cout << *param << std::endl;
44#endif   
45
46    log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Allocation");
47
48    allocation (
49#ifdef STATISTICS
50                param_statistics
51#endif
52                );
53
54#ifdef STATISTICS
55    if (usage_is_set(_usage,USE_STATISTICS))
56      { 
57        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Allocation of statistics");
58
59        statistics_declaration(param_statistics);
60      }
61#endif
62
63#ifdef VHDL
64    if (usage_is_set(_usage,USE_VHDL))
65      {
66        // generate the vhdl
67        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Generate the vhdl");
68       
69        vhdl();
70      }
71#endif
72
73#ifdef SYSTEMC
74    if (usage_is_set(_usage,USE_SYSTEMC))
75      {
76
77        // Constant : accepted already transaction
78        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
79          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
80            {
81              internal_RETIRE_EVENT_ACK [i][j] = 1;
82             
83              PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]);
84            }
85
86        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - transition");
87
88        SC_METHOD (transition);
89        dont_initialize ();
90        sensitive << (*(in_CLOCK)).pos();
91       
92# ifdef SYSTEMCASS_SPECIFIC
93        // List dependency information
94# endif   
95
96        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - genMealy_insert");
97
98        SC_METHOD (genMealy_insert);
99        dont_initialize ();
100        sensitive << (*(in_CLOCK)).neg();
101        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
102          {
103            if (_param->_have_port_front_end_id)
104            sensitive << (*(in_INSERT_FRONT_END_ID [i]));
105            if (_param->_have_port_context_id)
106            sensitive << (*(in_INSERT_CONTEXT_ID   [i]));
107            sensitive << (*(in_INSERT_VAL          [i]))
108                      << (*(in_INSERT_TYPE         [i]))
109                      << (*(in_INSERT_OPERATION    [i]));
110          }
111
112# ifdef SYSTEMCASS_SPECIFIC
113//      // List dependency information
114//      for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
115//        {
116//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_VAL                   [i]));
117//          if (_param->_have_port_front_end_id)
118//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_FRONT_END_ID          [i]));
119//          if (_param->_have_port_context_id)
120//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_CONTEXT_ID            [i]));
121//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_TYPE                  [i]));
122//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_OPERATION             [i]));
123 
124//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL                   [i]));
125//          if (_param->_have_port_front_end_id)
126//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID          [i]));
127//          if (_param->_have_port_context_id)
128//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID            [i]));
129//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE                  [i]));
130//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION             [i]));
131 
132//          if (_param->_have_port_load_queue_ptr)
133//            {
134//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_VAL                   [i]));
135//          if (_param->_have_port_front_end_id)
136//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_FRONT_END_ID          [i]));
137//          if (_param->_have_port_context_id)
138//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_CONTEXT_ID            [i]));
139//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_TYPE                  [i]));
140//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_OPERATION             [i]));
141//            }
142//        }
143# endif
144
145        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - genMealy_retire");
146
147        SC_METHOD (genMealy_retire);
148        dont_initialize ();
149        sensitive << (*(in_CLOCK)).neg();
150        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
151          {
152            if (_param->_have_port_front_end_id)
153            sensitive << (*(in_RETIRE_FRONT_END_ID          [i]));
154            if (_param->_have_port_context_id)
155            sensitive << (*(in_RETIRE_CONTEXT_ID            [i]));
156            if (_param->_have_port_load_queue_ptr)
157            sensitive << (*(in_RETIRE_LOAD_QUEUE_PTR_WRITE  [i]));
158            sensitive << (*(in_RETIRE_VAL                   [i]))
159//                    << (*(in_RETIRE_TYPE                  [i]))
160//                    << (*(in_RETIRE_OPERATION             [i]))
161                      << (*(in_RETIRE_USE_STORE_QUEUE       [i]))
162                      << (*(in_RETIRE_USE_LOAD_QUEUE        [i]))
163                      << (*(in_RETIRE_STORE_QUEUE_PTR_WRITE [i]));;
164          }
165
166# ifdef SYSTEMCASS_SPECIFIC
167        // List dependency information
168        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
169          {
170            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_VAL                   [i]));
171            if (_param->_have_port_front_end_id)
172            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_FRONT_END_ID          [i]));
173            if (_param->_have_port_context_id)
174            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_CONTEXT_ID            [i]));
175//          (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_TYPE                  [i]));
176//          (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_OPERATION             [i]));
177            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_USE_STORE_QUEUE       [i]));
178            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_USE_LOAD_QUEUE        [i]));
179            if (_param->_have_port_load_queue_ptr)
180            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_LOAD_QUEUE_PTR_WRITE  [i]));
181            (*(out_RETIRE_ACK                   [i])) (*( in_RETIRE_STORE_QUEUE_PTR_WRITE [i]));
182          }
183# endif
184
185#endif
186      }
187    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End");
188  };
189   
190#undef  FUNCTION
191#define FUNCTION "Load_Store_pointer_unit::~Load_Store_pointer_unit"
192  Load_Store_pointer_unit::~Load_Store_pointer_unit (void)
193  {
194    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin");
195
196#ifdef STATISTICS
197    if (usage_is_set(_usage,USE_STATISTICS))
198      {
199        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Generate Statistics file");
200       
201        delete _stat;
202      }
203#endif
204
205    log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Deallocation");
206    deallocation ();
207
208    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End");
209  };
210
211}; // end namespace load_store_pointer_unit
212}; // end namespace rename_unit
213}; // end namespace ooo_engine
214}; // end namespace multi_ooo_engine
215}; // end namespace core
216
217}; // end namespace behavioural
218}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.