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

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

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1/*
2 * $Id: Register_Address_Translation_unit.cpp 122 2009-06-03 08:15:51Z 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        // Constant : accepted already transaction
78        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
79          {
80            internal_RENAME_ACK [i] = 1;
81            internal_INSERT_ACK [i] = 1;
82
83            PORT_WRITE(out_RENAME_ACK[i],internal_RENAME_ACK [i]);
84            PORT_WRITE(out_INSERT_ACK[i],internal_INSERT_ACK [i]);
85          }
86
87        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
88          {
89            internal_RETIRE_ACK [i] = 1;
90
91            PORT_WRITE(out_RETIRE_ACK[i],internal_RETIRE_ACK [i]);
92          }
93
94        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
95          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
96            {
97              internal_RETIRE_EVENT_ACK [i][j] = 1;
98             
99              PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]);
100            }
101
102        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - transition");
103
104        SC_METHOD (transition);
105        dont_initialize ();
106        sensitive << (*(in_CLOCK)).pos();
107       
108# ifdef SYSTEMCASS_SPECIFIC
109        // List dependency information
110# endif   
111
112        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename");
113
114        SC_METHOD (genMealy_rename);
115        dont_initialize ();
116        sensitive << (*(in_CLOCK)).neg(); // need internal register
117        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
118          {
119            if (_param->_have_port_front_end_id) 
120            sensitive << (*(in_RENAME_FRONT_END_ID   [i]));
121            if (_param->_have_port_context_id  )
122            sensitive << (*(in_RENAME_CONTEXT_ID     [i]));
123           
124            sensitive << (*(in_RENAME_VAL            [i])) // Not necessary
125                      << (*(in_RENAME_NUM_REG_RA_LOG [i]))
126                      << (*(in_RENAME_NUM_REG_RB_LOG [i]))
127                      << (*(in_RENAME_NUM_REG_RC_LOG [i]))
128                      << (*(in_RENAME_NUM_REG_RD_LOG [i]))
129                      << (*(in_RENAME_NUM_REG_RE_LOG [i]));
130          }
131        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
132          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
133            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
134                      << (*(in_RETIRE_EVENT_STATE [i][j]));
135
136# ifdef SYSTEMCASS_SPECIFIC
137        // List dependency information
138# endif   
139
140        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_retire");
141
142        SC_METHOD (genMealy_retire);
143        dont_initialize ();
144        sensitive << (*(in_CLOCK)).neg(); // need internal register
145        for (uint32_t i=0; i<_param->_nb_inst_retire; ++i)
146          {
147            if (param->_have_port_front_end_id)
148            sensitive << (*(in_RETIRE_FRONT_END_ID   [i]));
149            if (param->_have_port_context_id)
150            sensitive << (*(in_RETIRE_CONTEXT_ID     [i]));
151           
152            sensitive << (*(in_RETIRE_WRITE_RD       [i]))
153                      << (*(in_RETIRE_WRITE_RE       [i]))
154                      << (*(in_RETIRE_NUM_REG_RD_LOG [i]))
155                      << (*(in_RETIRE_NUM_REG_RE_LOG [i]));
156          }
157
158        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
159          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
160            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
161                      << (*(in_RETIRE_EVENT_STATE [i][j]));
162       
163# ifdef SYSTEMCASS_SPECIFIC
164        // List dependency information
165# endif   
166       
167#endif
168      }
169    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
170  };
171   
172#undef  FUNCTION
173#define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit"
174  Register_Address_Translation_unit::~Register_Address_Translation_unit (void)
175  {
176    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
177
178#ifdef STATISTICS
179    if (usage_is_set(_usage,USE_STATISTICS))
180      {
181        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file");
182       
183        delete _stat;
184      }
185#endif
186
187    log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation");
188    deallocation ();
189
190    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
191  };
192
193}; // end namespace register_address_translation_unit
194}; // end namespace register_translation_unit
195}; // end namespace rename_unit
196}; // end namespace ooo_engine
197}; // end namespace multi_ooo_engine
198}; // end namespace core
199
200}; // end namespace behavioural
201}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.