[78] | 1 | /* |
---|
| 2 | * $Id: Rename_select.cpp 81 2008-04-15 18:40:01Z 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 | |
---|
| 40 | log_printf(INFO,Rename_select,FUNCTION,"Allocation"); |
---|
| 41 | |
---|
| 42 | allocation ( |
---|
| 43 | #ifdef STATISTICS |
---|
| 44 | param_statistics |
---|
| 45 | #endif |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | #ifdef STATISTICS |
---|
| 49 | if (_usage & USE_STATISTICS) |
---|
| 50 | { |
---|
| 51 | log_printf(INFO,Rename_select,FUNCTION,"Allocation of statistics"); |
---|
| 52 | |
---|
| 53 | statistics_declaration(param_statistics); |
---|
| 54 | } |
---|
| 55 | #endif |
---|
| 56 | |
---|
| 57 | #ifdef VHDL |
---|
| 58 | if (_usage & USE_VHDL) |
---|
| 59 | { |
---|
| 60 | // generate the vhdl |
---|
| 61 | log_printf(INFO,Rename_select,FUNCTION,"Generate the vhdl"); |
---|
| 62 | |
---|
| 63 | vhdl(); |
---|
| 64 | } |
---|
| 65 | #endif |
---|
| 66 | |
---|
| 67 | #ifdef SYSTEMC |
---|
| 68 | if (_usage & USE_SYSTEMC) |
---|
| 69 | { |
---|
| 70 | log_printf(INFO,Rename_select,FUNCTION,"Method - transition"); |
---|
| 71 | |
---|
| 72 | SC_METHOD (transition); |
---|
| 73 | dont_initialize (); |
---|
| 74 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 75 | |
---|
| 76 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 77 | // List dependency information |
---|
| 78 | # endif |
---|
| 79 | |
---|
| 80 | log_printf(INFO,Rename_select,FUNCTION,"Method - genMealy"); |
---|
| 81 | |
---|
| 82 | SC_METHOD (genMealy); |
---|
| 83 | dont_initialize (); |
---|
| 84 | sensitive << (*(in_CLOCK)).neg(); |
---|
| 85 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 86 | for (uint32_t j=0; j<_param->_nb_inst_decod [i]; j++) |
---|
| 87 | { |
---|
| 88 | sensitive << (*(in_RENAME_IN_VAL [i][j])) |
---|
| 89 | << (*(in_RENAME_IN_TYPE [i][j])) |
---|
| 90 | << (*(in_RENAME_IN_OPERATION [i][j])) |
---|
| 91 | << (*(in_RENAME_IN_ADDRESS [i][j])) |
---|
| 92 | << (*(in_RENAME_IN_HAS_IMMEDIAT [i][j])) |
---|
| 93 | << (*(in_RENAME_IN_IMMEDIAT [i][j])) |
---|
| 94 | << (*(in_RENAME_IN_READ_RA [i][j])) |
---|
| 95 | << (*(in_RENAME_IN_NUM_REG_RA [i][j])) |
---|
| 96 | << (*(in_RENAME_IN_READ_RB [i][j])) |
---|
| 97 | << (*(in_RENAME_IN_NUM_REG_RB [i][j])) |
---|
| 98 | << (*(in_RENAME_IN_READ_RC [i][j])) |
---|
| 99 | << (*(in_RENAME_IN_NUM_REG_RC [i][j])) |
---|
| 100 | << (*(in_RENAME_IN_WRITE_RD [i][j])) |
---|
| 101 | << (*(in_RENAME_IN_NUM_REG_RD [i][j])) |
---|
| 102 | << (*(in_RENAME_IN_WRITE_RE [i][j])) |
---|
| 103 | << (*(in_RENAME_IN_NUM_REG_RE [i][j])) |
---|
| 104 | << (*(in_RENAME_IN_EXCEPTION_USE [i][j])); |
---|
| 105 | if (_param->_have_port_front_end_id) |
---|
| 106 | sensitive << (*(in_RENAME_IN_FRONT_END_ID [i][j])); |
---|
| 107 | if (_param->_have_port_context_id) |
---|
| 108 | sensitive << (*(in_RENAME_IN_CONTEXT_ID [i][j])); |
---|
| 109 | if (_param->_have_port_depth) |
---|
| 110 | sensitive << (*(in_RENAME_IN_DEPTH [i][j])); |
---|
| 111 | } |
---|
| 112 | for (uint32_t i=0; i<_param->_nb_inst_rename; i++) |
---|
| 113 | sensitive << (*(in_RENAME_OUT_ACK [i])); |
---|
| 114 | |
---|
| 115 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 116 | // List dependency information |
---|
| 117 | |
---|
| 118 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 119 | for (uint32_t j=0; j<_param->_nb_inst_decod [i]; j++) |
---|
| 120 | for (uint32_t x=0; x<_param->_nb_inst_rename; x++) |
---|
| 121 | { |
---|
| 122 | (*(out_RENAME_IN_ACK [i][j])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 123 | (*(out_RENAME_IN_ACK [i][j])) (*(in_RENAME_OUT_ACK [x] )); |
---|
| 124 | } |
---|
| 125 | |
---|
| 126 | for (uint32_t x=0; x<_param->_nb_inst_rename; x++) |
---|
| 127 | { |
---|
| 128 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
| 129 | for (uint32_t j=0; j<_param->_nb_inst_decod [i]; j++) |
---|
| 130 | { |
---|
| 131 | (*(out_RENAME_OUT_VAL [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 132 | |
---|
| 133 | if (_param->_have_port_front_end_id) |
---|
| 134 | { |
---|
| 135 | (*(out_RENAME_OUT_FRONT_END_ID [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 136 | (*(out_RENAME_OUT_FRONT_END_ID [x])) (*(in_RENAME_IN_FRONT_END_ID [i][j])); |
---|
| 137 | } |
---|
| 138 | if (_param->_have_port_context_id) |
---|
| 139 | { |
---|
| 140 | (*(out_RENAME_OUT_CONTEXT_ID [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 141 | (*(out_RENAME_OUT_CONTEXT_ID [x])) (*(in_RENAME_IN_CONTEXT_ID [i][j])); |
---|
| 142 | } |
---|
| 143 | if (_param->_have_port_depth) |
---|
| 144 | { |
---|
| 145 | (*(out_RENAME_OUT_DEPTH [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 146 | (*(out_RENAME_OUT_DEPTH [x])) (*(in_RENAME_IN_DEPTH [i][j])); |
---|
| 147 | } |
---|
| 148 | (*(out_RENAME_OUT_TYPE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 149 | (*(out_RENAME_OUT_TYPE [x])) (*(in_RENAME_IN_TYPE [i][j])); |
---|
| 150 | (*(out_RENAME_OUT_OPERATION [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 151 | (*(out_RENAME_OUT_OPERATION [x])) (*(in_RENAME_IN_OPERATION [i][j])); |
---|
| 152 | (*(out_RENAME_OUT_ADDRESS [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 153 | (*(out_RENAME_OUT_ADDRESS [x])) (*(in_RENAME_IN_ADDRESS [i][j])); |
---|
| 154 | (*(out_RENAME_OUT_HAS_IMMEDIAT [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 155 | (*(out_RENAME_OUT_HAS_IMMEDIAT [x])) (*(in_RENAME_IN_HAS_IMMEDIAT [i][j])); |
---|
| 156 | (*(out_RENAME_OUT_IMMEDIAT [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 157 | (*(out_RENAME_OUT_IMMEDIAT [x])) (*(in_RENAME_IN_IMMEDIAT [i][j])); |
---|
| 158 | (*(out_RENAME_OUT_READ_RA [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 159 | (*(out_RENAME_OUT_READ_RA [x])) (*(in_RENAME_IN_READ_RA [i][j])); |
---|
| 160 | (*(out_RENAME_OUT_NUM_REG_RA [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 161 | (*(out_RENAME_OUT_NUM_REG_RA [x])) (*(in_RENAME_IN_NUM_REG_RA [i][j])); |
---|
| 162 | (*(out_RENAME_OUT_READ_RB [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 163 | (*(out_RENAME_OUT_READ_RB [x])) (*(in_RENAME_IN_READ_RB [i][j])); |
---|
| 164 | (*(out_RENAME_OUT_NUM_REG_RB [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 165 | (*(out_RENAME_OUT_NUM_REG_RB [x])) (*(in_RENAME_IN_NUM_REG_RB [i][j])); |
---|
| 166 | (*(out_RENAME_OUT_READ_RC [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 167 | (*(out_RENAME_OUT_READ_RC [x])) (*(in_RENAME_IN_READ_RC [i][j])); |
---|
| 168 | (*(out_RENAME_OUT_NUM_REG_RC [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 169 | (*(out_RENAME_OUT_NUM_REG_RC [x])) (*(in_RENAME_IN_NUM_REG_RC [i][j])); |
---|
| 170 | (*(out_RENAME_OUT_WRITE_RD [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 171 | (*(out_RENAME_OUT_WRITE_RD [x])) (*(in_RENAME_IN_WRITE_RD [i][j])); |
---|
| 172 | (*(out_RENAME_OUT_NUM_REG_RD [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 173 | (*(out_RENAME_OUT_NUM_REG_RD [x])) (*(in_RENAME_IN_NUM_REG_RD [i][j])); |
---|
| 174 | (*(out_RENAME_OUT_WRITE_RE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 175 | (*(out_RENAME_OUT_WRITE_RE [x])) (*(in_RENAME_IN_WRITE_RE [i][j])); |
---|
| 176 | (*(out_RENAME_OUT_NUM_REG_RE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 177 | (*(out_RENAME_OUT_NUM_REG_RE [x])) (*(in_RENAME_IN_NUM_REG_RE [i][j])); |
---|
| 178 | (*(out_RENAME_OUT_EXCEPTION_USE [x])) (*(in_RENAME_IN_VAL [i][j])); |
---|
| 179 | (*(out_RENAME_OUT_EXCEPTION_USE [x])) (*(in_RENAME_IN_EXCEPTION_USE [i][j])); |
---|
| 180 | } |
---|
| 181 | } |
---|
| 182 | # endif |
---|
| 183 | |
---|
| 184 | #endif |
---|
| 185 | } |
---|
| 186 | log_printf(FUNC,Rename_select,FUNCTION,"End"); |
---|
| 187 | }; |
---|
| 188 | |
---|
| 189 | #undef FUNCTION |
---|
| 190 | #define FUNCTION "Rename_select::~Rename_select" |
---|
| 191 | Rename_select::~Rename_select (void) |
---|
| 192 | { |
---|
| 193 | log_printf(FUNC,Rename_select,FUNCTION,"Begin"); |
---|
| 194 | |
---|
| 195 | #ifdef STATISTICS |
---|
| 196 | if (_usage & USE_STATISTICS) |
---|
| 197 | { |
---|
| 198 | log_printf(INFO,Rename_select,FUNCTION,"Generate Statistics file"); |
---|
| 199 | |
---|
| 200 | delete _stat; |
---|
| 201 | } |
---|
| 202 | #endif |
---|
| 203 | |
---|
| 204 | log_printf(INFO,Rename_select,FUNCTION,"Deallocation"); |
---|
| 205 | deallocation (); |
---|
| 206 | |
---|
| 207 | log_printf(FUNC,Rename_select,FUNCTION,"End"); |
---|
| 208 | }; |
---|
| 209 | |
---|
| 210 | }; // end namespace rename_select |
---|
| 211 | }; // end namespace rename_unit |
---|
| 212 | }; // end namespace ooo_engine |
---|
| 213 | }; // end namespace multi_ooo_engine |
---|
| 214 | }; // end namespace core |
---|
| 215 | |
---|
| 216 | }; // end namespace behavioural |
---|
| 217 | }; // end namespace morpheo |
---|