[78] | 1 | /* |
---|
| 2 | * $Id: Register_Address_Translation_unit.cpp 88 2008-12-10 18:31:39Z 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 | } |
---|
| 86 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
| 87 | { |
---|
| 88 | internal_RETIRE_ACK [i] = 1; |
---|
| 89 | |
---|
| 90 | PORT_WRITE(out_RETIRE_ACK[i],internal_RETIRE_ACK [i]); |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - transition"); |
---|
| 94 | |
---|
| 95 | SC_METHOD (transition); |
---|
| 96 | dont_initialize (); |
---|
| 97 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 98 | |
---|
| 99 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 100 | // List dependency information |
---|
| 101 | # endif |
---|
| 102 | |
---|
[88] | 103 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename"); |
---|
[78] | 104 | |
---|
[88] | 105 | SC_METHOD (genMealy_rename); |
---|
[78] | 106 | dont_initialize (); |
---|
[88] | 107 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
| 108 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
| 109 | { |
---|
| 110 | if (_param->_have_port_front_end_id) |
---|
| 111 | sensitive << (*(in_RENAME_FRONT_END_ID [i])); |
---|
| 112 | if (_param->_have_port_context_id ) |
---|
| 113 | sensitive << (*(in_RENAME_CONTEXT_ID [i])); |
---|
| 114 | |
---|
| 115 | sensitive << (*(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 | |
---|
| 122 | |
---|
| 123 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 124 | // List dependency information |
---|
| 125 | # endif |
---|
| 126 | |
---|
| 127 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_retire"); |
---|
| 128 | |
---|
| 129 | SC_METHOD (genMealy_retire); |
---|
| 130 | dont_initialize (); |
---|
| 131 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
| 132 | for (uint32_t i=0; i<_param->_nb_inst_retire; ++i) |
---|
| 133 | { |
---|
| 134 | if (param->_have_port_front_end_id) |
---|
| 135 | sensitive << (*(in_RETIRE_FRONT_END_ID [i])); |
---|
| 136 | if (param->_have_port_context_id) |
---|
| 137 | sensitive << (*(in_RETIRE_CONTEXT_ID [i])); |
---|
| 138 | |
---|
| 139 | sensitive << (*(in_RETIRE_EVENT_STATE [i])) |
---|
| 140 | << (*(in_RETIRE_WRITE_RD [i])) |
---|
| 141 | << (*(in_RETIRE_WRITE_RE [i])) |
---|
| 142 | << (*(in_RETIRE_NUM_REG_RD_LOG [i])) |
---|
| 143 | << (*(in_RETIRE_NUM_REG_RE_LOG [i])); |
---|
| 144 | } |
---|
[78] | 145 | |
---|
| 146 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 147 | // List dependency information |
---|
| 148 | # endif |
---|
| 149 | |
---|
| 150 | #endif |
---|
| 151 | } |
---|
| 152 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 153 | }; |
---|
| 154 | |
---|
| 155 | #undef FUNCTION |
---|
| 156 | #define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit" |
---|
| 157 | Register_Address_Translation_unit::~Register_Address_Translation_unit (void) |
---|
| 158 | { |
---|
| 159 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 160 | |
---|
| 161 | #ifdef STATISTICS |
---|
[88] | 162 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 163 | { |
---|
| 164 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file"); |
---|
| 165 | |
---|
| 166 | delete _stat; |
---|
| 167 | } |
---|
| 168 | #endif |
---|
| 169 | |
---|
| 170 | log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation"); |
---|
| 171 | deallocation (); |
---|
| 172 | |
---|
| 173 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 174 | }; |
---|
| 175 | |
---|
| 176 | }; // end namespace register_address_translation_unit |
---|
| 177 | }; // end namespace register_translation_unit |
---|
| 178 | }; // end namespace rename_unit |
---|
| 179 | }; // end namespace ooo_engine |
---|
| 180 | }; // end namespace multi_ooo_engine |
---|
| 181 | }; // end namespace core |
---|
| 182 | |
---|
| 183 | }; // end namespace behavioural |
---|
| 184 | }; // end namespace morpheo |
---|