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 @ 132

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

1) add constant method - compatibility with SystemC
2) add Script to test sensitive list
3) fix bug in sensitive list

  • Property svn:keywords set to Id
File size: 10.3 KB
Line 
1/*
2 * $Id: Dependency_checking_unit.cpp 132 2009-07-11 16:39:35Z 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        sensitive << (*(in_NRESET));
96        for (uint32_t i=0;i<_param->_nb_inst_insert; i++)
97          {
98            sensitive // << (*(in_RENAME_IN_VAL                [i]))
99//                    << (*(in_RENAME_OUT_ACK               [i]))
100                      << (*(in_RENAME_IN_READ_RA            [i]))
101                      << (*(in_RENAME_IN_NUM_REG_RA_LOG     [i]))
102                      << (*(in_RENAME_IN_NUM_REG_RA_PHY     [i]))
103                      << (*(in_RENAME_IN_READ_RB            [i]))
104                      << (*(in_RENAME_IN_NUM_REG_RB_LOG     [i]))
105                      << (*(in_RENAME_IN_NUM_REG_RB_PHY     [i]))
106                      << (*(in_RENAME_IN_READ_RC            [i]))
107                      << (*(in_RENAME_IN_NUM_REG_RC_LOG     [i]))
108                      << (*(in_RENAME_IN_NUM_REG_RC_PHY     [i]))
109                      << (*(in_RENAME_IN_WRITE_RD           [i]))
110                      << (*(in_RENAME_IN_NUM_REG_RD_LOG     [i]))
111                      << (*(in_RENAME_IN_NUM_REG_RD_PHY_OLD [i]))
112                      << (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [i]))
113                      << (*(in_RENAME_IN_WRITE_RE           [i]))
114                      << (*(in_RENAME_IN_NUM_REG_RE_LOG     [i]))
115                      << (*(in_RENAME_IN_NUM_REG_RE_PHY_OLD [i]))
116                      << (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [i]));
117            if (_param->_have_port_front_end_id)
118            sensitive << (*(in_RENAME_IN_FRONT_END_ID       [i]));
119            if (_param->_have_port_context_id)
120            sensitive << (*(in_RENAME_IN_CONTEXT_ID         [i]));
121          }
122
123# ifdef SYSTEMCASS_SPECIFIC
124        // List dependency information
125        for (uint32_t i=0;i<_param->_nb_inst_insert; i++)
126          {
127//          (*(out_RENAME_OUT_VAL                [i])) (*(in_RENAME_IN_VAL                [i]));
128//          (*(out_RENAME_IN_ACK                 [i])) (*(in_RENAME_OUT_ACK               [i]));
129            if (_param->_have_port_front_end_id)
130            (*(out_RENAME_OUT_FRONT_END_ID       [i])) (*(in_RENAME_IN_FRONT_END_ID       [i]));
131            if (_param->_have_port_context_id)
132            (*(out_RENAME_OUT_CONTEXT_ID         [i])) (*(in_RENAME_IN_CONTEXT_ID         [i]));
133            (*(out_RENAME_OUT_READ_RA            [i])) (*(in_RENAME_IN_READ_RA            [i]));
134#ifdef DEBUG
135            (*(out_RENAME_OUT_NUM_REG_RA_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RA_LOG     [i]));
136#endif
137            (*(out_RENAME_OUT_READ_RB            [i])) (*(in_RENAME_IN_READ_RB            [i]));
138#ifdef DEBUG
139            (*(out_RENAME_OUT_NUM_REG_RB_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RB_LOG     [i]));
140#endif
141            (*(out_RENAME_OUT_READ_RC            [i])) (*(in_RENAME_IN_READ_RC            [i]));
142#ifdef DEBUG
143            (*(out_RENAME_OUT_NUM_REG_RC_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RC_LOG     [i]));
144#endif
145            (*(out_RENAME_OUT_WRITE_RD           [i])) (*(in_RENAME_IN_WRITE_RD           [i]));
146            (*(out_RENAME_OUT_NUM_REG_RD_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [i]));
147            (*(out_RENAME_OUT_NUM_REG_RD_PHY_NEW [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [i]));
148            (*(out_RENAME_OUT_WRITE_RE           [i])) (*(in_RENAME_IN_WRITE_RE           [i]));
149            (*(out_RENAME_OUT_NUM_REG_RE_LOG     [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [i]));
150            (*(out_RENAME_OUT_NUM_REG_RE_PHY_NEW [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [i]));
151
152            (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_OLD [i]));
153            (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RD           [i]));
154            (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [i]));
155            for (int32_t j=i-1; j>=0; j--)
156              {
157                if (_param->_have_port_front_end_id)
158                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
159                if (_param->_have_port_context_id)
160                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
161                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RD           [j]));
162                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [j]));
163                (*(out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j]));
164              }
165
166            (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_OLD [i]));
167            (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RE           [i]));
168            (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [i]));
169            for (int32_t j=i-1; j>=0; j--)
170              {
171                if (_param->_have_port_front_end_id)
172                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
173                if (_param->_have_port_context_id)
174                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
175                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_WRITE_RE           [j]));
176                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [j]));
177                (*(out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [j]));
178              }
179
180            (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RA_PHY     [i]));
181            (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_READ_RA            [i]));
182            (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RA_LOG     [i]));
183            for (int32_t j=i-1; j>=0; j--)
184              {
185                if (_param->_have_port_front_end_id)
186                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
187                if (_param->_have_port_context_id)
188                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
189                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_WRITE_RD           [j]));
190                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [j]));
191                (*(out_RENAME_OUT_NUM_REG_RA_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j]));
192              }
193
194            (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RB_PHY     [i]));
195            (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_READ_RB            [i]));
196            (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RB_LOG     [i]));
197            for (int32_t j=i-1; j>=0; j--)
198              {
199                if (_param->_have_port_front_end_id)
200                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
201                if (_param->_have_port_context_id)
202                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
203                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_WRITE_RD           [j]));
204                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_LOG     [j]));
205                (*(out_RENAME_OUT_NUM_REG_RB_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RD_PHY_NEW [j]));
206              }
207
208            (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RC_PHY     [i]));
209            (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_READ_RC            [i]));
210            (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RC_LOG     [i]));
211            for (int32_t j=i-1; j>=0; j--)
212              {
213                if (_param->_have_port_front_end_id)
214                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_FRONT_END_ID       [j]));
215                if (_param->_have_port_context_id)
216                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_CONTEXT_ID         [j]));
217                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_WRITE_RE           [j]));
218                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RE_LOG     [j]));
219                (*(out_RENAME_OUT_NUM_REG_RC_PHY     [i])) (*(in_RENAME_IN_NUM_REG_RE_PHY_NEW [j]));
220              }
221          }
222# endif   
223
224      }
225#endif
226    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"End");
227  };
228   
229#undef  FUNCTION
230#define FUNCTION "Dependency_checking_unit::~Dependency_checking_unit"
231  Dependency_checking_unit::~Dependency_checking_unit (void)
232  {
233    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"Begin");
234
235#ifdef STATISTICS
236    if (usage_is_set(_usage,USE_STATISTICS))
237      {
238        log_printf(INFO,Dependency_checking_unit,FUNCTION,"Generate Statistics file");
239       
240        delete _stat;
241      }
242#endif
243
244    log_printf(INFO,Dependency_checking_unit,FUNCTION,"Deallocation");
245    deallocation ();
246
247    log_printf(FUNC,Dependency_checking_unit,FUNCTION,"End");
248  };
249
250}; // end namespace dependency_checking_unit
251}; // end namespace register_translation_unit
252}; // end namespace rename_unit
253}; // end namespace ooo_engine
254}; // end namespace multi_ooo_engine
255}; // end namespace core
256
257}; // end namespace behavioural
258}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.