1 | /* |
---|
2 | * $Id: Register_Address_Translation_unit.cpp 139 2010-07-30 14:47:27Z 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 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_ooo_engine { |
---|
14 | namespace ooo_engine { |
---|
15 | namespace rename_unit { |
---|
16 | namespace register_translation_unit { |
---|
17 | namespace 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 | // Function pointer |
---|
78 | switch (_param->_rat_scheme) |
---|
79 | { |
---|
80 | case RAT_NO_SAVE : |
---|
81 | { |
---|
82 | // function_constant = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_no_save_constant ; |
---|
83 | // function_transition = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_no_save_transition ; |
---|
84 | // function_genMealy_rename = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_no_save_genMealy_rename; |
---|
85 | |
---|
86 | break; |
---|
87 | } |
---|
88 | |
---|
89 | case RAT_ONE_SAVE : |
---|
90 | { |
---|
91 | function_constant = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_one_save_constant ; |
---|
92 | function_transition = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_one_save_transition ; |
---|
93 | function_genMealy_rename = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_one_save_genMealy_rename; |
---|
94 | |
---|
95 | break; |
---|
96 | } |
---|
97 | |
---|
98 | case RAT_DEPTH_SAVE : |
---|
99 | { |
---|
100 | function_constant = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_depth_save_constant ; |
---|
101 | function_transition = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_depth_save_transition ; |
---|
102 | function_genMealy_rename = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_depth_save_genMealy_rename; |
---|
103 | |
---|
104 | break; |
---|
105 | } |
---|
106 | |
---|
107 | default : |
---|
108 | { |
---|
109 | break; |
---|
110 | } |
---|
111 | } |
---|
112 | |
---|
113 | #ifdef SYSTEMCASS_SPECIFIC |
---|
114 | constant(); |
---|
115 | #else |
---|
116 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - constant"); |
---|
117 | |
---|
118 | SC_METHOD (constant); |
---|
119 | // dont_initialize (); |
---|
120 | |
---|
121 | # ifdef SYSTEMCASS_SPECIFIC |
---|
122 | // List dependency information |
---|
123 | # endif |
---|
124 | #endif |
---|
125 | |
---|
126 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - transition"); |
---|
127 | |
---|
128 | SC_METHOD (transition); |
---|
129 | dont_initialize (); |
---|
130 | sensitive << (*(in_CLOCK)).pos(); |
---|
131 | |
---|
132 | # ifdef SYSTEMCASS_SPECIFIC |
---|
133 | // List dependency information |
---|
134 | # endif |
---|
135 | |
---|
136 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename"); |
---|
137 | |
---|
138 | SC_METHOD (genMealy_rename); |
---|
139 | dont_initialize (); |
---|
140 | sensitive << (*(in_CLOCK)).neg() // need internal register |
---|
141 | << (*(in_NRESET)); |
---|
142 | |
---|
143 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
144 | { |
---|
145 | if (_param->_have_port_front_end_id) |
---|
146 | sensitive << (*(in_RENAME_FRONT_END_ID [i])); |
---|
147 | if (_param->_have_port_context_id ) |
---|
148 | sensitive << (*(in_RENAME_CONTEXT_ID [i])); |
---|
149 | |
---|
150 | sensitive << (*(in_RENAME_VAL [i])) // Not necessary |
---|
151 | << (*(in_RENAME_NUM_REG_RA_LOG [i])) |
---|
152 | << (*(in_RENAME_NUM_REG_RB_LOG [i])) |
---|
153 | << (*(in_RENAME_NUM_REG_RC_LOG [i])) |
---|
154 | << (*(in_RENAME_NUM_REG_RD_LOG [i])) |
---|
155 | << (*(in_RENAME_NUM_REG_RE_LOG [i])); |
---|
156 | |
---|
157 | if (_param->_rat_scheme == RAT_DEPTH_SAVE) |
---|
158 | sensitive << (*(in_RENAME_SAVE_RAT [i])); |
---|
159 | } |
---|
160 | for (uint32_t i=0; i<_param->_nb_front_end; ++i) |
---|
161 | for (uint32_t j=0; j<_param->_nb_context[i]; ++j) |
---|
162 | sensitive << (*(in_RETIRE_EVENT_VAL [i][j])) |
---|
163 | << (*(in_RETIRE_EVENT_STATE [i][j])); |
---|
164 | |
---|
165 | # ifdef SYSTEMCASS_SPECIFIC |
---|
166 | // List dependency information |
---|
167 | # endif |
---|
168 | |
---|
169 | #endif |
---|
170 | } |
---|
171 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
172 | }; |
---|
173 | |
---|
174 | #undef FUNCTION |
---|
175 | #define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit" |
---|
176 | Register_Address_Translation_unit::~Register_Address_Translation_unit (void) |
---|
177 | { |
---|
178 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
179 | |
---|
180 | #ifdef STATISTICS |
---|
181 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
182 | { |
---|
183 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file"); |
---|
184 | |
---|
185 | delete _stat; |
---|
186 | } |
---|
187 | #endif |
---|
188 | |
---|
189 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation"); |
---|
190 | deallocation (); |
---|
191 | |
---|
192 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
193 | }; |
---|
194 | |
---|
195 | }; // end namespace register_address_translation_unit |
---|
196 | }; // end namespace register_translation_unit |
---|
197 | }; // end namespace rename_unit |
---|
198 | }; // end namespace ooo_engine |
---|
199 | }; // end namespace multi_ooo_engine |
---|
200 | }; // end namespace core |
---|
201 | |
---|
202 | }; // end namespace behavioural |
---|
203 | }; // end namespace morpheo |
---|