source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit.cpp @ 131

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

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1/*
2 * $Id: Reexecute_unit.cpp 131 2009-07-08 18:40:08Z 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
116        for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++)
117          {
118            if (_param->_have_port_context_id)
119            sensitive << (*(in_REEXECUTE_ROB_CONTEXT_ID            [i]));
120            if (_param->_have_port_front_end_id)
121            sensitive << (*(in_REEXECUTE_ROB_FRONT_END_ID          [i]));
122            if (_param->_have_port_rob_ptr  )
123            sensitive << (*(in_REEXECUTE_ROB_PACKET_ID             [i]));
124            sensitive << (*(in_REEXECUTE_ROB_OPERATION             [i]))
125                      << (*(in_REEXECUTE_ROB_TYPE                  [i]))
126                      << (*(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE [i]));
127          }
128
129# ifdef SYSTEMCASS_SPECIFIC
130        // List dependency information
131# endif   
132
133        log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMealy_commit"),_name.c_str());
134
135        SC_METHOD (genMealy_commit);
136        dont_initialize ();
137        sensitive << (*(in_CLOCK)).neg(); // need internal register
138
139        for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
140          for (uint32_t j=0; j<_param->_nb_inst_execute [i]; ++j)
141            {
142              if (_param->_have_port_context_id)
143              sensitive << (*(in_EXECUTE_LOOP_CONTEXT_ID   [i][j]));
144              if (_param->_have_port_front_end_id)
145              sensitive << (*(in_EXECUTE_LOOP_FRONT_END_ID [i][j]));
146              if (_param->_have_port_rob_ptr  )
147              sensitive << (*(in_EXECUTE_LOOP_PACKET_ID    [i][j]));
148              sensitive << (*(in_EXECUTE_LOOP_VAL          [i][j]))
149//                      << (*(in_EXECUTE_LOOP_OPERATION    [i][j]))
150//                      << (*(in_EXECUTE_LOOP_TYPE         [i][j]))
151                        << (*(in_EXECUTE_LOOP_FLAGS        [i][j]))
152                        << (*(in_EXECUTE_LOOP_EXCEPTION    [i][j]))
153                        << (*(in_EXECUTE_LOOP_NO_SEQUENCE  [i][j]))
154                        << (*(in_EXECUTE_LOOP_ADDRESS      [i][j]))
155                        << (*(in_EXECUTE_LOOP_DATA         [i][j]));
156            }
157        for (uint32_t i=0; i<_param->_nb_inst_commit; ++i)
158          sensitive << (*(in_COMMIT_ACK [i]));
159
160# ifdef SYSTEMCASS_SPECIFIC
161        // List dependency information
162# endif   
163
164#endif
165      }
166    log_end(Reexecute_unit,FUNCTION);
167  };
168   
169#undef  FUNCTION
170#define FUNCTION "Reexecute_unit::~Reexecute_unit"
171  Reexecute_unit::~Reexecute_unit (void)
172  {
173    log_begin(Reexecute_unit,FUNCTION);
174
175#ifdef STATISTICS
176    if (usage_is_set(_usage,USE_STATISTICS))
177      {
178        statistics_deallocation();
179      }
180#endif
181
182    log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
183    deallocation ();
184
185    log_end(Reexecute_unit,FUNCTION);
186  };
187
188}; // end namespace reexecute_unit
189}; // end namespace ooo_engine
190}; // end namespace multi_ooo_engine
191}; // end namespace core
192
193}; // end namespace behavioural
194}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.