[78] | 1 | /* |
---|
| 2 | * $Id: Register_Address_Translation_unit.cpp 106 2009-02-09 22:55:26Z 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 | |
---|
[88] | 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 | |
---|
[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 | { |
---|
| 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 | } |
---|
[104] | 86 | |
---|
[78] | 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 | |
---|
[104] | 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 | |
---|
[78] | 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 | |
---|
[88] | 112 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename"); |
---|
[78] | 113 | |
---|
[88] | 114 | SC_METHOD (genMealy_rename); |
---|
[78] | 115 | dont_initialize (); |
---|
[88] | 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 | |
---|
[100] | 124 | sensitive << (*(in_RENAME_VAL [i])) // Not necessary |
---|
| 125 | << (*(in_RENAME_NUM_REG_RA_LOG [i])) |
---|
[88] | 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])); |
---|
[104] | 130 | } |
---|
[88] | 131 | |
---|
| 132 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 133 | // List dependency information |
---|
| 134 | # endif |
---|
| 135 | |
---|
| 136 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_retire"); |
---|
| 137 | |
---|
| 138 | SC_METHOD (genMealy_retire); |
---|
| 139 | dont_initialize (); |
---|
| 140 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
| 141 | for (uint32_t i=0; i<_param->_nb_inst_retire; ++i) |
---|
| 142 | { |
---|
| 143 | if (param->_have_port_front_end_id) |
---|
| 144 | sensitive << (*(in_RETIRE_FRONT_END_ID [i])); |
---|
| 145 | if (param->_have_port_context_id) |
---|
| 146 | sensitive << (*(in_RETIRE_CONTEXT_ID [i])); |
---|
| 147 | |
---|
[104] | 148 | sensitive << (*(in_RETIRE_WRITE_RD [i])) |
---|
[88] | 149 | << (*(in_RETIRE_WRITE_RE [i])) |
---|
| 150 | << (*(in_RETIRE_NUM_REG_RD_LOG [i])) |
---|
| 151 | << (*(in_RETIRE_NUM_REG_RE_LOG [i])); |
---|
| 152 | } |
---|
[104] | 153 | |
---|
| 154 | for (uint32_t i=0; i<_param->_nb_front_end; ++i) |
---|
| 155 | for (uint32_t j=0; j<_param->_nb_context[i]; ++j) |
---|
[106] | 156 | sensitive << (*(in_RETIRE_EVENT_VAL [i][j])) |
---|
| 157 | << (*(in_RETIRE_EVENT_STATE [i][j])); |
---|
[78] | 158 | |
---|
| 159 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 160 | // List dependency information |
---|
| 161 | # endif |
---|
| 162 | |
---|
| 163 | #endif |
---|
| 164 | } |
---|
| 165 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 166 | }; |
---|
| 167 | |
---|
| 168 | #undef FUNCTION |
---|
| 169 | #define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit" |
---|
| 170 | Register_Address_Translation_unit::~Register_Address_Translation_unit (void) |
---|
| 171 | { |
---|
| 172 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 173 | |
---|
| 174 | #ifdef STATISTICS |
---|
[88] | 175 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 176 | { |
---|
| 177 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file"); |
---|
| 178 | |
---|
| 179 | delete _stat; |
---|
| 180 | } |
---|
| 181 | #endif |
---|
| 182 | |
---|
| 183 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation"); |
---|
| 184 | deallocation (); |
---|
| 185 | |
---|
| 186 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 187 | }; |
---|
| 188 | |
---|
| 189 | }; // end namespace register_address_translation_unit |
---|
| 190 | }; // end namespace register_translation_unit |
---|
| 191 | }; // end namespace rename_unit |
---|
| 192 | }; // end namespace ooo_engine |
---|
| 193 | }; // end namespace multi_ooo_engine |
---|
| 194 | }; // end namespace core |
---|
| 195 | |
---|
| 196 | }; // end namespace behavioural |
---|
| 197 | }; // end namespace morpheo |
---|