[78] | 1 | /* |
---|
| 2 | * $Id: Register_Address_Translation_unit.cpp 145 2010-10-13 18: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 | |
---|
| 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 | |
---|
[123] | 41 | // #if DEBUG_Register_Address_Translation_unit == true |
---|
| 42 | // log_printf(INFO,Register_Address_Translation_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 43 | |
---|
[123] | 44 | // std::cout << *param << std::endl; |
---|
| 45 | // #endif |
---|
[88] | 46 | |
---|
[78] | 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 |
---|
[88] | 56 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 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 |
---|
[88] | 65 | if (usage_is_set(_usage,USE_VHDL)) |
---|
[78] | 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 |
---|
[88] | 75 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
[78] | 76 | { |
---|
[139] | 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 | |
---|
[131] | 113 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 114 | constant(); |
---|
| 115 | #else |
---|
| 116 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - constant"); |
---|
[78] | 117 | |
---|
[131] | 118 | SC_METHOD (constant); |
---|
| 119 | // dont_initialize (); |
---|
| 120 | |
---|
| 121 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 122 | // List dependency information |
---|
| 123 | # endif |
---|
| 124 | #endif |
---|
[104] | 125 | |
---|
[78] | 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 | |
---|
[88] | 136 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename"); |
---|
[78] | 137 | |
---|
[88] | 138 | SC_METHOD (genMealy_rename); |
---|
[78] | 139 | dont_initialize (); |
---|
[132] | 140 | sensitive << (*(in_CLOCK)).neg() // need internal register |
---|
| 141 | << (*(in_NRESET)); |
---|
| 142 | |
---|
[88] | 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 | |
---|
[100] | 150 | sensitive << (*(in_RENAME_VAL [i])) // Not necessary |
---|
| 151 | << (*(in_RENAME_NUM_REG_RA_LOG [i])) |
---|
[88] | 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])); |
---|
[139] | 156 | |
---|
| 157 | if (_param->_rat_scheme == RAT_DEPTH_SAVE) |
---|
| 158 | sensitive << (*(in_RENAME_SAVE_RAT [i])); |
---|
[104] | 159 | } |
---|
[122] | 160 | for (uint32_t i=0; i<_param->_nb_front_end; ++i) |
---|
| 161 | for (uint32_t j=0; j<_param->_nb_context[i]; ++j) |
---|
[145] | 162 | { |
---|
| 163 | sensitive << (*(in_RETIRE_EVENT_VAL [i][j])) |
---|
| 164 | << (*(in_RETIRE_EVENT_STATE [i][j])) |
---|
| 165 | << (*(in_DEPTH_FULL [i][j])); |
---|
| 166 | if (_param->_have_port_depth) |
---|
| 167 | sensitive << (*(in_DEPTH_MIN [i][j])) |
---|
| 168 | << (*(in_DEPTH_MAX [i][j])); |
---|
| 169 | } |
---|
[88] | 170 | |
---|
| 171 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 172 | // List dependency information |
---|
| 173 | # endif |
---|
[78] | 174 | |
---|
| 175 | #endif |
---|
| 176 | } |
---|
| 177 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 178 | }; |
---|
| 179 | |
---|
| 180 | #undef FUNCTION |
---|
| 181 | #define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit" |
---|
| 182 | Register_Address_Translation_unit::~Register_Address_Translation_unit (void) |
---|
| 183 | { |
---|
| 184 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 185 | |
---|
| 186 | #ifdef STATISTICS |
---|
[88] | 187 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 188 | { |
---|
| 189 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file"); |
---|
| 190 | |
---|
| 191 | delete _stat; |
---|
| 192 | } |
---|
| 193 | #endif |
---|
| 194 | |
---|
| 195 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation"); |
---|
| 196 | deallocation (); |
---|
| 197 | |
---|
| 198 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 199 | }; |
---|
| 200 | |
---|
| 201 | }; // end namespace register_address_translation_unit |
---|
| 202 | }; // end namespace register_translation_unit |
---|
| 203 | }; // end namespace rename_unit |
---|
| 204 | }; // end namespace ooo_engine |
---|
| 205 | }; // end namespace multi_ooo_engine |
---|
| 206 | }; // end namespace core |
---|
| 207 | |
---|
| 208 | }; // end namespace behavioural |
---|
| 209 | }; // end namespace morpheo |
---|