source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit/src/Dependency_checking_unit.cpp @ 123

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

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

  • Property svn:keywords set to Id
File size: 10.2 KB
Line 
1/*
2 * $Id: Dependency_checking_unit.cpp 123 2009-06-08 20:43:30Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit/include/Dependency_checking_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace rename_unit {
16namespace register_translation_unit {
17namespace dependency_checking_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Dependency_checking_unit::Dependency_checking_unit"
22  Dependency_checking_unit::Dependency_checking_unit
23  (
24#ifdef SYSTEMC
25   sc_module_name name,
26#else
27   string name,
28#endif
29#ifdef STATISTICS
30   morpheo::behavioural::Parameters_Statistics * param_statistics,
31#endif
32   morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::dependency_checking_unit::Parameters * param,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37    ,_usage            (usage)
38  {
39    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"Begin");
40
41// #if DEBUG_Dependency_checking_unit == true
42//     log_printf(INFO,Dependency_checking_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47    log_printf(INFO,Dependency_checking_unit,FUNCTION,"Allocation");
48
49    allocation (
50#ifdef STATISTICS
51                param_statistics
52#endif
53                );
54
55#ifdef STATISTICS
56    if (usage_is_set(_usage,USE_STATISTICS))
57      { 
58        log_printf(INFO,Dependency_checking_unit,FUNCTION,"Allocation of statistics");
59
60        statistics_declaration(param_statistics);
61      }
62#endif
63
64#ifdef VHDL
65    if (usage_is_set(_usage,USE_VHDL))
66      {
67        // generate the vhdl
68        log_printf(INFO,Dependency_checking_unit,FUNCTION,"Generate the vhdl");
69       
70        vhdl();
71      }
72#endif
73
74#ifdef SYSTEMC
75    if (usage_is_set(_usage,USE_SYSTEMC))
76      {
77# if defined(STATISTICS) or defined(VHDL_TESTBENCH)
78
79        log_printf(INFO,Dependency_checking_unit,FUNCTION,"Method - transition");
80
81        SC_METHOD (transition);
82        dont_initialize ();
83        sensitive << (*(in_CLOCK)).pos();
84       
85#  ifdef SYSTEMCASS_SPECIFIC
86        // List dependency information
87#  endif   
88# endif
89
90        log_printf(INFO,Dependency_checking_unit,FUNCTION,"Method - genMealy");
91       
92        SC_METHOD (genMealy);
93        dont_initialize ();
94//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
95        for (uint32_t i=0;i<_param->_nb_inst_insert; i++)
96          {
97            sensitive // << (*(in_RENAME_IN_VAL                [i]))
98//                    << (*(in_RENAME_OUT_ACK               [i]))
99                      << (*(in_RENAME_IN_READ_RA            [i]))
100                      << (*(in_RENAME_IN_NUM_REG_RA_LOG     [i]))
101                      << (*(in_RENAME_IN_NUM_REG_RA_PHY     [i]))
102                      << (*(in_RENAME_IN_READ_RB            [i]))
103                      << (*(in_RENAME_IN_NUM_REG_RB_LOG     [i]))
104                      << (*(in_RENAME_IN_NUM_REG_RB_PHY     [i]))
105                      << (*(in_RENAME_IN_READ_RC            [i]))
106                      << (*(in_RENAME_IN_NUM_REG_RC_LOG     [i]))
107                      << (*(in_RENAME_IN_NUM_REG_RC_PHY     [i]))
108                      << (*(in_RENAME_IN_WRITE_RD           [i]))
109                      << (*(in_RENAME_IN_NUM_REG_RD_LOG     [i]))
110                      << (*(in_RENAME_IN_NUM_REG_RD_PHY_OLD [i]))
111                      << (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [i]))
112                      << (*(in_RENAME_IN_WRITE_RE           [i]))
113                      << (*(in_RENAME_IN_NUM_REG_RE_LOG     [i]))
114                      << (*(in_RENAME_IN_NUM_REG_RE_PHY_OLD [i]))
115                      << (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [i]));
116            if (_param->_have_port_front_end_id)
117            sensitive << (*(in_RENAME_IN_FRONT_END_ID       [i]));
118            if (_param->_have_port_context_id)
119            sensitive << (*(in_RENAME_IN_CONTEXT_ID         [i]));
120          }
121
122# ifdef SYSTEMCASS_SPECIFIC
123        // List dependency information
124        for (uint32_t i=0;i<_param->_nb_inst_insert; i++)
125          {
126//          (*(out_RENAME_OUT_VAL                [i])) (*(in_RENAME_IN_VAL                [i]));
127//          (*(out_RENAME_IN_ACK                 [i])) (*(in_RENAME_OUT_ACK               [i]));
128            if (_param->_have_port_front_end_id)
129            (*(out_RENAME_OUT_FRONT_END_ID       [i])) (*(in_RENAME_IN_FRONT_END_ID       [i]));
130            if (_param->_have_port_context_id)
131            (*(out_RENAME_OUT_CONTEXT_ID         [i])) (*(in_RENAME_IN_CONTEXT_ID         [i]));
132            (*(out_RENAME_OUT_READ_RA            [i])) (*(in_RENAME_IN_READ_RA            [i]));
133#ifdef DEBUG
134            (*(out_RENAME_OUT_NUM_REG_RA_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RA_LOG     [i]));
135#endif
136            (*(out_RENAME_OUT_READ_RB            [i])) (*(in_RENAME_IN_READ_RB            [i]));
137#ifdef DEBUG
138            (*(out_RENAME_OUT_NUM_REG_RB_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RB_LOG     [i]));
139#endif
140            (*(out_RENAME_OUT_READ_RC            [i])) (*(in_RENAME_IN_READ_RC            [i]));
141#ifdef DEBUG
142            (*(out_RENAME_OUT_NUM_REG_RC_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RC_LOG     [i]));
143#endif
144            (*(out_RENAME_OUT_WRITE_RD           [i])) (*(in_RENAME_IN_WRITE_RD           [i]));
145            (*(out_RENAME_OUT_NUM_REG_RD_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [i]));
146            (*(out_RENAME_OUT_NUM_REG_RD_PHY_NEW [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [i]));
147            (*(out_RENAME_OUT_WRITE_RE           [i])) (*(in_RENAME_IN_WRITE_RE           [i]));
148            (*(out_RENAME_OUT_NUM_REG_RE_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [i]));
149            (*(out_RENAME_OUT_NUM_REG_RE_PHY_NEW [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [i]));
150
151            (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_OLD [i]));
152            (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RD           [i]));
153            (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [i]));
154            for (int32_t j=i-1; j>=0; j--)
155              {
156                if (_param->_have_port_front_end_id)
157                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
158                if (_param->_have_port_context_id)
159                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
160                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RD           [j]));
161                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [j]));
162                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j]));
163              }
164
165            (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_OLD [i]));
166            (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RE           [i]));
167            (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [i]));
168            for (int32_t j=i-1; j>=0; j--)
169              {
170                if (_param->_have_port_front_end_id)
171                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
172                if (_param->_have_port_context_id)
173                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
174                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RE           [j]));
175                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [j]));
176                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [j]));
177              }
178
179            (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RA_PHY     [i]));
180            (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_READ_RA            [i]));
181            (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RA_LOG     [i]));
182            for (int32_t j=i-1; j>=0; j--)
183              {
184                if (_param->_have_port_front_end_id)
185                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
186                if (_param->_have_port_context_id)
187                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
188                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_WRITE_RD           [j]));
189                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [j]));
190                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j]));
191              }
192
193            (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RB_PHY     [i]));
194            (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_READ_RB            [i]));
195            (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RB_LOG     [i]));
196            for (int32_t j=i-1; j>=0; j--)
197              {
198                if (_param->_have_port_front_end_id)
199                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
200                if (_param->_have_port_context_id)
201                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
202                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_WRITE_RD           [j]));
203                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [j]));
204                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j]));
205              }
206
207            (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RC_PHY     [i]));
208            (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_READ_RC            [i]));
209            (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RC_LOG     [i]));
210            for (int32_t j=i-1; j>=0; j--)
211              {
212                if (_param->_have_port_front_end_id)
213                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
214                if (_param->_have_port_context_id)
215                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
216                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_WRITE_RE           [j]));
217                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [j]));
218                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [j]));
219              }
220          }
221# endif   
222
223      }
224#endif
225    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"End");
226  };
227   
228#undef  FUNCTION
229#define FUNCTION "Dependency_checking_unit::~Dependency_checking_unit"
230  Dependency_checking_unit::~Dependency_checking_unit (void)
231  {
232    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"Begin");
233
234#ifdef STATISTICS
235    if (usage_is_set(_usage,USE_STATISTICS))
236      {
237        log_printf(INFO,Dependency_checking_unit,FUNCTION,"Generate Statistics file");
238       
239        delete _stat;
240      }
241#endif
242
243    log_printf(INFO,Dependency_checking_unit,FUNCTION,"Deallocation");
244    deallocation ();
245
246    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"End");
247  };
248
249}; // end namespace dependency_checking_unit
250}; // end namespace register_translation_unit
251}; // end namespace rename_unit
252}; // end namespace ooo_engine
253}; // end namespace multi_ooo_engine
254}; // end namespace core
255
256}; // end namespace behavioural
257}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.