[78] | 1 | /* |
---|
| 2 | * $Id: Rename_select.cpp 132 2009-07-11 16:39:35Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.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 rename_select { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Rename_select::Rename_select" |
---|
| 21 | Rename_select::Rename_select |
---|
| 22 | ( |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | string name, |
---|
| 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 30 | #endif |
---|
| 31 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select::Parameters * param, |
---|
| 32 | morpheo::behavioural::Tusage_t usage |
---|
| 33 | ): |
---|
| 34 | _name (name) |
---|
| 35 | ,_param (param) |
---|
| 36 | ,_usage (usage) |
---|
| 37 | { |
---|
| 38 | log_printf(FUNC,Rename_select,FUNCTION,"Begin"); |
---|
| 39 | |
---|
[123] | 40 | // #if DEBUG_Core == true |
---|
| 41 | // log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 42 | |
---|
[123] | 43 | // std::cout << *param << std::endl; |
---|
| 44 | // #endif |
---|
[88] | 45 | |
---|
[78] | 46 | log_printf(INFO,Rename_select,FUNCTION,"Allocation"); |
---|
| 47 | |
---|
| 48 | allocation ( |
---|
| 49 | #ifdef STATISTICS |
---|
| 50 | param_statistics |
---|
| 51 | #endif |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | #ifdef STATISTICS |
---|
[88] | 55 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 56 | { |
---|
| 57 | log_printf(INFO,Rename_select,FUNCTION,"Allocation of statistics"); |
---|
| 58 | |
---|
| 59 | statistics_declaration(param_statistics); |
---|
| 60 | } |
---|
| 61 | #endif |
---|
| 62 | |
---|
| 63 | #ifdef VHDL |
---|
[88] | 64 | if (usage_is_set(_usage,USE_VHDL)) |
---|
[78] | 65 | { |
---|
| 66 | // generate the vhdl |
---|
| 67 | log_printf(INFO,Rename_select,FUNCTION,"Generate the vhdl"); |
---|
| 68 | |
---|
| 69 | vhdl(); |
---|
| 70 | } |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | #ifdef SYSTEMC |
---|
[88] | 74 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
[78] | 75 | { |
---|
| 76 | log_printf(INFO,Rename_select,FUNCTION,"Method - transition"); |
---|
| 77 | |
---|
| 78 | SC_METHOD (transition); |
---|
| 79 | dont_initialize (); |
---|
| 80 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 81 | |
---|
| 82 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 83 | // List dependency information |
---|
| 84 | # endif |
---|
| 85 | |
---|
| 86 | log_printf(INFO,Rename_select,FUNCTION,"Method - genMealy"); |
---|
| 87 | |
---|
| 88 | SC_METHOD (genMealy); |
---|
| 89 | dont_initialize (); |
---|
[132] | 90 | sensitive << (*(in_CLOCK)).neg() |
---|
| 91 | << (*(in_NRESET)); |
---|
| 92 | |
---|
[78] | 93 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 94 | for (uint32_t j=0; j<_param->_nb_inst_decod [i]; j++) |
---|
| 95 | { |
---|
| 96 | sensitive << (*(in_RENAME_IN_VAL [i][j])) |
---|
| 97 | << (*(in_RENAME_IN_TYPE [i][j])) |
---|
| 98 | << (*(in_RENAME_IN_OPERATION [i][j])) |
---|
[88] | 99 | << (*(in_RENAME_IN_NO_EXECUTE [i][j])) |
---|
[123] | 100 | // << (*(in_RENAME_IN_HAVE_EVENT [i][j])) |
---|
| 101 | << (*(in_RENAME_IN_LAST_EVENT [i][j])) |
---|
[88] | 102 | << (*(in_RENAME_IN_IS_DELAY_SLOT [i][j])) |
---|
[108] | 103 | #ifdef DEBUG |
---|
| 104 | << (*(in_RENAME_IN_ADDRESS [i][j])) |
---|
| 105 | #endif |
---|
[105] | 106 | << (*(in_RENAME_IN_ADDRESS_NEXT [i][j])) |
---|
[78] | 107 | << (*(in_RENAME_IN_HAS_IMMEDIAT [i][j])) |
---|
| 108 | << (*(in_RENAME_IN_IMMEDIAT [i][j])) |
---|
| 109 | << (*(in_RENAME_IN_READ_RA [i][j])) |
---|
| 110 | << (*(in_RENAME_IN_NUM_REG_RA [i][j])) |
---|
| 111 | << (*(in_RENAME_IN_READ_RB [i][j])) |
---|
| 112 | << (*(in_RENAME_IN_NUM_REG_RB [i][j])) |
---|
| 113 | << (*(in_RENAME_IN_READ_RC [i][j])) |
---|
| 114 | << (*(in_RENAME_IN_NUM_REG_RC [i][j])) |
---|
| 115 | << (*(in_RENAME_IN_WRITE_RD [i][j])) |
---|
| 116 | << (*(in_RENAME_IN_NUM_REG_RD [i][j])) |
---|
| 117 | << (*(in_RENAME_IN_WRITE_RE [i][j])) |
---|
| 118 | << (*(in_RENAME_IN_NUM_REG_RE [i][j])) |
---|
[88] | 119 | << (*(in_RENAME_IN_EXCEPTION_USE [i][j])) |
---|
| 120 | << (*(in_RENAME_IN_EXCEPTION [i][j])); |
---|
[78] | 121 | if (_param->_have_port_front_end_id) |
---|
| 122 | sensitive << (*(in_RENAME_IN_FRONT_END_ID [i][j])); |
---|
| 123 | if (_param->_have_port_context_id) |
---|
| 124 | sensitive << (*(in_RENAME_IN_CONTEXT_ID [i][j])); |
---|
| 125 | if (_param->_have_port_depth) |
---|
| 126 | sensitive << (*(in_RENAME_IN_DEPTH [i][j])); |
---|
| 127 | } |
---|
[108] | 128 | |
---|
[111] | 129 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 130 | for (uint32_t j=0; j<_param->_nb_context [i]; j++) |
---|
[123] | 131 | sensitive // << (*(in_RETIRE_EVENT_FLUSH [i][j])) |
---|
[122] | 132 | << (*(in_RETIRE_EVENT_STOP [i][j])); |
---|
[108] | 133 | |
---|
[78] | 134 | for (uint32_t i=0; i<_param->_nb_inst_rename; i++) |
---|
| 135 | sensitive << (*(in_RENAME_OUT_ACK [i])); |
---|
| 136 | |
---|
| 137 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 138 | // List dependency information |
---|
| 139 | |
---|
| 140 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 141 | for (uint32_t j=0; j<_param->_nb_inst_decod [i]; j++) |
---|
| 142 | for (uint32_t x=0; x<_param->_nb_inst_rename; x++) |
---|
| 143 | { |
---|
| 144 | (*(out_RENAME_IN_ACK [i][j])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 145 | (*(out_RENAME_IN_ACK [i][j])) (*(in_RENAME_OUT_ACK [x] )); |
---|
| 146 | } |
---|
| 147 | |
---|
| 148 | for (uint32_t x=0; x<_param->_nb_inst_rename; x++) |
---|
| 149 | { |
---|
| 150 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 151 | for (uint32_t j=0; j<_param->_nb_inst_decod [i]; j++) |
---|
| 152 | { |
---|
| 153 | (*(out_RENAME_OUT_VAL [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 154 | |
---|
| 155 | if (_param->_have_port_front_end_id) |
---|
| 156 | { |
---|
| 157 | (*(out_RENAME_OUT_FRONT_END_ID [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 158 | (*(out_RENAME_OUT_FRONT_END_ID [x])) (*(in_RENAME_IN_FRONT_END_ID [i][j])); |
---|
| 159 | } |
---|
| 160 | if (_param->_have_port_context_id) |
---|
| 161 | { |
---|
| 162 | (*(out_RENAME_OUT_CONTEXT_ID [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 163 | (*(out_RENAME_OUT_CONTEXT_ID [x])) (*(in_RENAME_IN_CONTEXT_ID [i][j])); |
---|
| 164 | } |
---|
| 165 | if (_param->_have_port_depth) |
---|
| 166 | { |
---|
| 167 | (*(out_RENAME_OUT_DEPTH [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 168 | (*(out_RENAME_OUT_DEPTH [x])) (*(in_RENAME_IN_DEPTH [i][j])); |
---|
| 169 | } |
---|
| 170 | (*(out_RENAME_OUT_TYPE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 171 | (*(out_RENAME_OUT_TYPE [x])) (*(in_RENAME_IN_TYPE [i][j])); |
---|
| 172 | (*(out_RENAME_OUT_OPERATION [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 173 | (*(out_RENAME_OUT_OPERATION [x])) (*(in_RENAME_IN_OPERATION [i][j])); |
---|
[88] | 174 | (*(out_RENAME_OUT_NO_EXECUTE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 175 | (*(out_RENAME_OUT_NO_EXECUTE [x])) (*(in_RENAME_IN_NO_EXECUTE [i][j])); |
---|
| 176 | (*(out_RENAME_OUT_IS_DELAY_SLOT [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 177 | (*(out_RENAME_OUT_IS_DELAY_SLOT [x])) (*(in_RENAME_IN_IS_DELAY_SLOT [i][j])); |
---|
[108] | 178 | #ifdef DEBUG |
---|
| 179 | (*(out_RENAME_OUT_ADDRESS [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 180 | (*(out_RENAME_OUT_ADDRESS [x])) (*(in_RENAME_IN_ADDRESS [i][j])); |
---|
| 181 | #endif |
---|
[105] | 182 | (*(out_RENAME_OUT_ADDRESS_NEXT [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 183 | (*(out_RENAME_OUT_ADDRESS_NEXT [x])) (*(in_RENAME_IN_ADDRESS_NEXT [i][j])); |
---|
[78] | 184 | (*(out_RENAME_OUT_HAS_IMMEDIAT [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 185 | (*(out_RENAME_OUT_HAS_IMMEDIAT [x])) (*(in_RENAME_IN_HAS_IMMEDIAT [i][j])); |
---|
| 186 | (*(out_RENAME_OUT_IMMEDIAT [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 187 | (*(out_RENAME_OUT_IMMEDIAT [x])) (*(in_RENAME_IN_IMMEDIAT [i][j])); |
---|
| 188 | (*(out_RENAME_OUT_READ_RA [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 189 | (*(out_RENAME_OUT_READ_RA [x])) (*(in_RENAME_IN_READ_RA [i][j])); |
---|
| 190 | (*(out_RENAME_OUT_NUM_REG_RA [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 191 | (*(out_RENAME_OUT_NUM_REG_RA [x])) (*(in_RENAME_IN_NUM_REG_RA [i][j])); |
---|
| 192 | (*(out_RENAME_OUT_READ_RB [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 193 | (*(out_RENAME_OUT_READ_RB [x])) (*(in_RENAME_IN_READ_RB [i][j])); |
---|
| 194 | (*(out_RENAME_OUT_NUM_REG_RB [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 195 | (*(out_RENAME_OUT_NUM_REG_RB [x])) (*(in_RENAME_IN_NUM_REG_RB [i][j])); |
---|
| 196 | (*(out_RENAME_OUT_READ_RC [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 197 | (*(out_RENAME_OUT_READ_RC [x])) (*(in_RENAME_IN_READ_RC [i][j])); |
---|
| 198 | (*(out_RENAME_OUT_NUM_REG_RC [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 199 | (*(out_RENAME_OUT_NUM_REG_RC [x])) (*(in_RENAME_IN_NUM_REG_RC [i][j])); |
---|
| 200 | (*(out_RENAME_OUT_WRITE_RD [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 201 | (*(out_RENAME_OUT_WRITE_RD [x])) (*(in_RENAME_IN_WRITE_RD [i][j])); |
---|
| 202 | (*(out_RENAME_OUT_NUM_REG_RD [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 203 | (*(out_RENAME_OUT_NUM_REG_RD [x])) (*(in_RENAME_IN_NUM_REG_RD [i][j])); |
---|
| 204 | (*(out_RENAME_OUT_WRITE_RE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 205 | (*(out_RENAME_OUT_WRITE_RE [x])) (*(in_RENAME_IN_WRITE_RE [i][j])); |
---|
| 206 | (*(out_RENAME_OUT_NUM_REG_RE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 207 | (*(out_RENAME_OUT_NUM_REG_RE [x])) (*(in_RENAME_IN_NUM_REG_RE [i][j])); |
---|
| 208 | (*(out_RENAME_OUT_EXCEPTION_USE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 209 | (*(out_RENAME_OUT_EXCEPTION_USE [x])) (*(in_RENAME_IN_EXCEPTION_USE [i][j])); |
---|
[88] | 210 | (*(out_RENAME_OUT_EXCEPTION [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 211 | (*(out_RENAME_OUT_EXCEPTION [x])) (*(in_RENAME_IN_EXCEPTION [i][j])); |
---|
[78] | 212 | } |
---|
| 213 | } |
---|
| 214 | # endif |
---|
| 215 | |
---|
| 216 | #endif |
---|
| 217 | } |
---|
| 218 | log_printf(FUNC,Rename_select,FUNCTION,"End"); |
---|
| 219 | }; |
---|
| 220 | |
---|
| 221 | #undef FUNCTION |
---|
| 222 | #define FUNCTION "Rename_select::~Rename_select" |
---|
| 223 | Rename_select::~Rename_select (void) |
---|
| 224 | { |
---|
| 225 | log_printf(FUNC,Rename_select,FUNCTION,"Begin"); |
---|
| 226 | |
---|
| 227 | #ifdef STATISTICS |
---|
[88] | 228 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 229 | { |
---|
| 230 | log_printf(INFO,Rename_select,FUNCTION,"Generate Statistics file"); |
---|
| 231 | |
---|
| 232 | delete _stat; |
---|
| 233 | } |
---|
| 234 | #endif |
---|
| 235 | |
---|
| 236 | log_printf(INFO,Rename_select,FUNCTION,"Deallocation"); |
---|
| 237 | deallocation (); |
---|
| 238 | |
---|
| 239 | log_printf(FUNC,Rename_select,FUNCTION,"End"); |
---|
| 240 | }; |
---|
| 241 | |
---|
| 242 | }; // end namespace rename_select |
---|
| 243 | }; // end namespace rename_unit |
---|
| 244 | }; // end namespace ooo_engine |
---|
| 245 | }; // end namespace multi_ooo_engine |
---|
| 246 | }; // end namespace core |
---|
| 247 | |
---|
| 248 | }; // end namespace behavioural |
---|
| 249 | }; // end namespace morpheo |
---|