source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_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.7 KB
Line 
1/*
2 * $Id: Register_Address_Translation_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/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace rename_unit {
16namespace register_translation_unit {
17namespace register_address_translation_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Register_Address_Translation_unit::Register_Address_Translation_unit"
22  Register_Address_Translation_unit::Register_Address_Translation_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::register_address_translation_unit::Parameters * param,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37    ,_usage            (usage)
38  {
39    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
40
41// #if DEBUG_Register_Address_Translation_unit == true
42//     log_printf(INFO,Register_Address_Translation_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47    log_printf(INFO,Register_Address_Translation_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,Register_Address_Translation_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,Register_Address_Translation_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#ifdef SYSTEMCASS_SPECIFIC
78        constant();
79#else
80        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - constant");
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,Register_Address_Translation_unit,FUNCTION,"Method - transition");
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,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename");
101
102        SC_METHOD (genMealy_rename);
103        dont_initialize ();
104        sensitive << (*(in_CLOCK)).neg() // need internal register
105                  << (*(in_NRESET));
106
107        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
108          {
109            if (_param->_have_port_front_end_id) 
110            sensitive << (*(in_RENAME_FRONT_END_ID   [i]));
111            if (_param->_have_port_context_id  )
112            sensitive << (*(in_RENAME_CONTEXT_ID     [i]));
113           
114            sensitive << (*(in_RENAME_VAL            [i])) // Not necessary
115                      << (*(in_RENAME_NUM_REG_RA_LOG [i]))
116                      << (*(in_RENAME_NUM_REG_RB_LOG [i]))
117                      << (*(in_RENAME_NUM_REG_RC_LOG [i]))
118                      << (*(in_RENAME_NUM_REG_RD_LOG [i]))
119                      << (*(in_RENAME_NUM_REG_RE_LOG [i]));
120          }
121        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
122          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
123            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
124                      << (*(in_RETIRE_EVENT_STATE [i][j]));
125
126# ifdef SYSTEMCASS_SPECIFIC
127        // List dependency information
128# endif   
129
130        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_retire");
131
132        SC_METHOD (genMealy_retire);
133        dont_initialize ();
134        sensitive << (*(in_CLOCK)).neg() // need internal register
135                  << (*(in_NRESET));
136
137        for (uint32_t i=0; i<_param->_nb_inst_retire; ++i)
138          {
139            if (param->_have_port_front_end_id)
140            sensitive << (*(in_RETIRE_FRONT_END_ID   [i]));
141            if (param->_have_port_context_id)
142            sensitive << (*(in_RETIRE_CONTEXT_ID     [i]));
143           
144            sensitive << (*(in_RETIRE_WRITE_RD       [i]))
145                      << (*(in_RETIRE_WRITE_RE       [i]))
146                      << (*(in_RETIRE_NUM_REG_RD_LOG [i]))
147                      << (*(in_RETIRE_NUM_REG_RE_LOG [i]));
148          }
149
150        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
151          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
152            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
153                      << (*(in_RETIRE_EVENT_STATE [i][j]));
154       
155# ifdef SYSTEMCASS_SPECIFIC
156        // List dependency information
157# endif   
158       
159#endif
160      }
161    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
162  };
163   
164#undef  FUNCTION
165#define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit"
166  Register_Address_Translation_unit::~Register_Address_Translation_unit (void)
167  {
168    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
169
170#ifdef STATISTICS
171    if (usage_is_set(_usage,USE_STATISTICS))
172      {
173        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file");
174       
175        delete _stat;
176      }
177#endif
178
179    log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation");
180    deallocation ();
181
182    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
183  };
184
185}; // end namespace register_address_translation_unit
186}; // end namespace register_translation_unit
187}; // end namespace rename_unit
188}; // end namespace ooo_engine
189}; // end namespace multi_ooo_engine
190}; // end namespace core
191
192}; // end namespace behavioural
193}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.