source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_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: 5.3 KB
Line 
1/*
2 * $Id: Reexecute_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/Reexecute_unit/include/Reexecute_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace reexecute_unit {
16
17
18#undef  FUNCTION
19#define FUNCTION "Reexecute_unit::Reexecute_unit"
20  Reexecute_unit::Reexecute_unit
21  (
22#ifdef SYSTEMC
23   sc_module_name name,
24#else
25   string name,
26#endif
27#ifdef STATISTICS
28   morpheo::behavioural::Parameters_Statistics * param_statistics,
29#endif
30   morpheo::behavioural::core::multi_ooo_engine::ooo_engine::reexecute_unit::Parameters * param,
31   morpheo::behavioural::Tusage_t usage
32   ):
33    _name              (name)
34    ,_param            (param)
35    ,_usage            (usage)
36  {
37    log_begin(Reexecute_unit,FUNCTION);
38
39    usage_environment(_usage);
40
41// #if DEBUG_Reexecute_unit == true
42//     log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47    log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Allocation"),_name.c_str());
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,Reexecute_unit,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
59
60        statistics_allocation(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,Reexecute_unit,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
69       
70        vhdl();
71      }
72#endif
73
74#ifdef SYSTEMC
75    if (usage_is_set(_usage,USE_SYSTEMC))
76      {
77#ifdef SYSTEMCASS_SPECIFIC
78        constant();
79#else
80        log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - constant"),_name.c_str());
81
82        SC_METHOD (constant);
83//      dont_initialize ();
84       
85# ifdef SYSTEMCASS_SPECIFIC
86        // List dependency information
87# endif   
88#endif
89
90        log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
91
92        SC_METHOD (transition);
93        dont_initialize ();
94        sensitive << (*(in_CLOCK)).pos();
95       
96# ifdef SYSTEMCASS_SPECIFIC
97        // List dependency information
98# endif   
99
100        log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());
101
102        SC_METHOD (genMoore);
103        dont_initialize ();
104        sensitive << (*(in_CLOCK)).neg(); // need internal register
105       
106# ifdef SYSTEMCASS_SPECIFIC
107        // List dependency information
108# endif   
109
110        log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMealy_reexecute"),_name.c_str());
111
112        SC_METHOD (genMealy_reexecute);
113        dont_initialize ();
114        sensitive << (*(in_CLOCK)).neg() // need internal register
115                  << (*(in_NRESET));
116
117        for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++)
118          {
119            if (_param->_have_port_context_id)
120            sensitive << (*(in_REEXECUTE_ROB_CONTEXT_ID            [i]));
121            if (_param->_have_port_front_end_id)
122            sensitive << (*(in_REEXECUTE_ROB_FRONT_END_ID          [i]));
123            if (_param->_have_port_rob_ptr  )
124            sensitive << (*(in_REEXECUTE_ROB_PACKET_ID             [i]));
125            sensitive << (*(in_REEXECUTE_ROB_VAL                   [i]))
126                      << (*(in_REEXECUTE_ACK                       [i]))
127                      << (*(in_REEXECUTE_ROB_OPERATION             [i]))
128                      << (*(in_REEXECUTE_ROB_TYPE                  [i]))
129                      << (*(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE [i]));
130          }
131
132# ifdef SYSTEMCASS_SPECIFIC
133        // List dependency information
134# endif   
135
136        log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMealy_commit"),_name.c_str());
137
138        SC_METHOD (genMealy_commit);
139        dont_initialize ();
140        sensitive << (*(in_CLOCK)).neg() // need internal register
141                  << (*(in_NRESET));
142
143        for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
144          for (uint32_t j=0; j<_param->_nb_inst_execute [i]; ++j)
145            {
146              if (_param->_have_port_context_id)
147              sensitive << (*(in_EXECUTE_LOOP_CONTEXT_ID   [i][j]));
148              if (_param->_have_port_front_end_id)
149              sensitive << (*(in_EXECUTE_LOOP_FRONT_END_ID [i][j]));
150              if (_param->_have_port_rob_ptr  )
151              sensitive << (*(in_EXECUTE_LOOP_PACKET_ID    [i][j]));
152              sensitive << (*(in_EXECUTE_LOOP_VAL          [i][j]))
153//                      << (*(in_EXECUTE_LOOP_OPERATION    [i][j]))
154//                      << (*(in_EXECUTE_LOOP_TYPE         [i][j]))
155                        << (*(in_EXECUTE_LOOP_FLAGS        [i][j]))
156                        << (*(in_EXECUTE_LOOP_EXCEPTION    [i][j]))
157                        << (*(in_EXECUTE_LOOP_NO_SEQUENCE  [i][j]))
158                        << (*(in_EXECUTE_LOOP_ADDRESS      [i][j]))
159                        << (*(in_EXECUTE_LOOP_DATA         [i][j]));
160            }
161        for (uint32_t i=0; i<_param->_nb_inst_commit; ++i)
162          sensitive << (*(in_COMMIT_ACK [i]));
163
164# ifdef SYSTEMCASS_SPECIFIC
165        // List dependency information
166# endif   
167
168#endif
169      }
170    log_end(Reexecute_unit,FUNCTION);
171  };
172   
173#undef  FUNCTION
174#define FUNCTION "Reexecute_unit::~Reexecute_unit"
175  Reexecute_unit::~Reexecute_unit (void)
176  {
177    log_begin(Reexecute_unit,FUNCTION);
178
179#ifdef STATISTICS
180    if (usage_is_set(_usage,USE_STATISTICS))
181      {
182        statistics_deallocation();
183      }
184#endif
185
186    log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
187    deallocation ();
188
189    log_end(Reexecute_unit,FUNCTION);
190  };
191
192}; // end namespace reexecute_unit
193}; // end namespace ooo_engine
194}; // end namespace multi_ooo_engine
195}; // end namespace core
196
197}; // end namespace behavioural
198}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.