[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Core_Glue_genMealy_issue.cpp 122 2009-06-03 08:15:51Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Core_Glue/include/Core_Glue.h" |
---|
| 10 | #include "Common/include/Max.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace core_glue { |
---|
| 16 | |
---|
[117] | 17 | /* |
---|
| 18 | OOO SLOT Execute Loop |
---|
| 19 | ---+ +----- |
---|
| 20 | | +-----+ +-----+ | |
---|
| 21 | -+->| | | |-+-> |
---|
| 22 | | | |-()->| | | |
---|
| 23 | -+->| _ _ | | |-+-> |
---|
| 24 | | | _X_ |-()->| | | |
---|
| 25 | -+->| | | | +----- |
---|
| 26 | | | |-()->| | |
---|
| 27 | -+->| | | | +----- |
---|
| 28 | | +-----+ | | | |
---|
| 29 | ---+ crossbar | _ _ |-+-> |
---|
| 30 | | _X_ | | |
---|
| 31 | ---+ | |-+-> |
---|
| 32 | | +-----+ | | | |
---|
| 33 | -+->| | | | +----- |
---|
| 34 | | | |-()->| | |
---|
| 35 | -+->| _ _ | | | +----- |
---|
| 36 | | | _X_ |-()->| | | |
---|
| 37 | -+->| | | |-+-> |
---|
| 38 | | | |-()->| | | |
---|
| 39 | -+->| | | |-+-> |
---|
| 40 | | +-----+ +-----+ | |
---|
| 41 | ---+ crossbar dispatch +----- |
---|
| 42 | */ |
---|
[88] | 43 | |
---|
[117] | 44 | |
---|
| 45 | // class num_read_unit_t |
---|
| 46 | // { |
---|
| 47 | // public : const uint32_t num_execute_loop; |
---|
| 48 | // public : const uint32_t num_read_unit; |
---|
| 49 | |
---|
| 50 | // public : num_read_unit_t (uint32_t num_execute_loop, |
---|
| 51 | // uint32_t num_read_unit) : |
---|
| 52 | // this->num_execute_loop (num_execute_loop), |
---|
| 53 | // this->num_read_unit (num_read_unit ) |
---|
| 54 | // {}; |
---|
| 55 | // } |
---|
| 56 | |
---|
[88] | 57 | #undef FUNCTION |
---|
| 58 | #define FUNCTION "Core_Glue::genMealy_issue" |
---|
| 59 | void Core_Glue::genMealy_issue (void) |
---|
| 60 | { |
---|
| 61 | log_begin(Core_Glue,FUNCTION); |
---|
| 62 | log_function(Core_Glue,FUNCTION,_name.c_str()); |
---|
| 63 | |
---|
[117] | 64 | Tcontrol_t ISSUE_OOO_ENGINE_ACK [_param->_nb_ooo_engine ][_param->_max_nb_inst_issue_queue]; |
---|
| 65 | Tcontrol_t ISSUE_EXECUTE_LOOP_VAL [_param->_nb_execute_loop][_param->_max_nb_read_unit]; |
---|
| 66 | Tcontrol_t READ_UNIT_ENABLE [_param->_nb_execute_loop][_param->_max_nb_read_unit]; |
---|
| 67 | Tcontrol_t SLOT_ENABLE [_param->_nb_ooo_engine ][_param->_max_nb_inst_issue_slot]; |
---|
| 68 | |
---|
[115] | 69 | // Init -> all at 0 |
---|
[88] | 70 | for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i) |
---|
[117] | 71 | { |
---|
| 72 | for (uint32_t j=0; j<_param->_nb_inst_issue_queue[i]; ++j) |
---|
| 73 | ISSUE_OOO_ENGINE_ACK [i][j] = 0; |
---|
| 74 | for (uint32_t j=0; j<_param->_nb_inst_issue_slot[i]; ++j) |
---|
| 75 | SLOT_ENABLE [i][j] = 1; |
---|
| 76 | } |
---|
| 77 | |
---|
[88] | 78 | for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) |
---|
| 79 | for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j) |
---|
| 80 | { |
---|
| 81 | ISSUE_EXECUTE_LOOP_VAL [i][j] = 0; |
---|
[117] | 82 | |
---|
[88] | 83 | // Read unit is enable is signal ack is set |
---|
| 84 | READ_UNIT_ENABLE [i][j] = (PORT_READ(in_ISSUE_EXECUTE_LOOP_ACK [i][j]) == 1); |
---|
[117] | 85 | log_printf(TRACE,Core_Glue,FUNCTION," * Read_unit [%d][%d].enable : %d",i,j,READ_UNIT_ENABLE[i][j]); |
---|
[88] | 86 | } |
---|
| 87 | |
---|
[117] | 88 | // std::list<num_read_unit_t> SLOT_TYPE [_param->_nb_ooo_engine][_param->_max_nb_inst_issue_slot][_param->_nb_type]; |
---|
[88] | 89 | |
---|
[117] | 90 | // // for each read_unit |
---|
| 91 | // for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) |
---|
| 92 | // for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j) |
---|
| 93 | // // test if this read_unit can receive an instruction |
---|
| 94 | // if (PORT_READ(in_ISSUE_EXECUTE_LOOP_ACK [i][j]) == 1) |
---|
| 95 | // for (uint32_t x=0; x<_nb_ooo_engine; ++x) |
---|
| 96 | // for (uint32_t y=0; y<_nb_inst_issue_slot[y]; ++y) |
---|
| 97 | // // test if can dispatch |
---|
| 98 | // if (_param->_table_dispatch [x][y][i][j]) |
---|
| 99 | // for (uint32_t k=0;k<_param->_nb_type; ++k) |
---|
| 100 | // // Can receive this type |
---|
| 101 | // if (_param->_table_dispatch [i][j][k]) |
---|
| 102 | // SLOT_TYPE[x][y][k].push_back(num_read_unit_t(i,j)); |
---|
[88] | 103 | |
---|
[117] | 104 | // // Select an issue_slot of an ooo_engine |
---|
| 105 | // std::list<generic::priority::select_t> * select_ooo_engine = _priority_ooo_engine->select(); |
---|
| 106 | // for (std::list<generic::priority::select_t>::iterator it_ooo_engine=select_ooo_engine->begin(); |
---|
| 107 | // it_ooo_engine!=select_ooo_engine->end(); |
---|
| 108 | // ++it_ooo_engine) |
---|
| 109 | // { |
---|
| 110 | // // ... get id of the most priotary |
---|
| 111 | // const uint32_t num_ooo_engine = it_ooo_engine->grp; |
---|
| 112 | // const uint32_t num_inst_issue_slot = it_ooo_engine->elt; |
---|
[88] | 113 | |
---|
[117] | 114 | // // Test if this ooo_engine is enable (can be desable if issue in_order) |
---|
| 115 | // if (OOO_ENGINE_ENABLE[num_ooo_engine]) |
---|
| 116 | // { |
---|
[111] | 117 | |
---|
[117] | 118 | // } |
---|
| 119 | // } |
---|
[115] | 120 | |
---|
[120] | 121 | // for (uint32_t num_ooo_engine=0; num_ooo_engine<_param->_nb_ooo_engine; ++num_ooo_engine) |
---|
[111] | 122 | |
---|
[120] | 123 | std::list<generic::priority::select_t> * select_ooo_engine = _priority_ooo_engine->select(); |
---|
| 124 | for (std::list<generic::priority::select_t>::iterator it_ooo_engine=select_ooo_engine->begin(); |
---|
| 125 | it_ooo_engine!=select_ooo_engine->end(); |
---|
| 126 | ++it_ooo_engine) |
---|
| 127 | { |
---|
| 128 | uint32_t num_ooo_engine = it_ooo_engine->grp; |
---|
[88] | 129 | |
---|
[120] | 130 | for (uint32_t num_inst_issue_queue=0; num_inst_issue_queue<_param->_nb_inst_issue_queue[num_ooo_engine]; ++num_inst_issue_queue) |
---|
| 131 | { |
---|
| 132 | bool find = false; |
---|
| 133 | |
---|
| 134 | Tcontrol_t val = PORT_READ(in_ISSUE_OOO_ENGINE_VAL [num_ooo_engine][num_inst_issue_queue]); |
---|
| 135 | Ttype_t type = PORT_READ(in_ISSUE_OOO_ENGINE_TYPE [num_ooo_engine][num_inst_issue_queue]); |
---|
| 136 | |
---|
| 137 | log_printf(TRACE,Core_Glue,FUNCTION," * num_ooo_engine : %d",num_ooo_engine ); |
---|
| 138 | log_printf(TRACE,Core_Glue,FUNCTION," * num_inst_issue_queue : %d",num_inst_issue_queue); |
---|
| 139 | log_printf(TRACE,Core_Glue,FUNCTION," * val : %d",val); |
---|
| 140 | log_printf(TRACE,Core_Glue,FUNCTION," * type : %d",type); |
---|
| 141 | |
---|
| 142 | if (val) |
---|
| 143 | for (uint32_t num_inst_issue_slot=0; num_inst_issue_slot<_param->_nb_inst_issue_slot[num_ooo_engine]; ++num_inst_issue_slot) |
---|
| 144 | { |
---|
| 145 | log_printf(TRACE,Core_Glue,FUNCTION," * num_inst_issue_slot : %d",num_inst_issue_slot); |
---|
| 146 | |
---|
| 147 | // scan all read_unit |
---|
| 148 | |
---|
| 149 | if (SLOT_ENABLE [num_ooo_engine][num_inst_issue_slot]) |
---|
| 150 | for (uint32_t num_execute_loop=0; num_execute_loop<_param->_nb_execute_loop; ++num_execute_loop) |
---|
| 151 | { |
---|
| 152 | std::list<generic::priority::select_t> * select_read_unit = _priority_read_unit[num_execute_loop]->select(); |
---|
| 153 | for (std::list<generic::priority::select_t>::iterator it_read_unit=select_read_unit->begin(); |
---|
| 154 | it_read_unit!=select_read_unit->end(); |
---|
| 155 | ++it_read_unit) |
---|
| 156 | { |
---|
| 157 | // get the most priotary ... |
---|
| 158 | uint32_t num_read_unit = it_read_unit->grp; |
---|
| 159 | Tcontrol_t ack = READ_UNIT_ENABLE [num_execute_loop][num_read_unit]; |
---|
| 160 | |
---|
| 161 | log_printf(TRACE,Core_Glue,FUNCTION," * num_execute_loop : %d",num_execute_loop); |
---|
| 162 | log_printf(TRACE,Core_Glue,FUNCTION," * num_read_unit : %d",num_read_unit ); |
---|
| 163 | log_printf(TRACE,Core_Glue,FUNCTION," * read_unit_enable : %d",ack ); |
---|
| 164 | |
---|
| 165 | // test if : |
---|
| 166 | // * read_unit can accept an instruction (valid and no previous instruction) |
---|
| 167 | // * slot can issue an instruction at this read_unit |
---|
| 168 | // * read_unit can accept this type |
---|
| 169 | if (ack and |
---|
| 170 | _param->_table_dispatch [num_ooo_engine][num_inst_issue_slot][num_execute_loop][num_read_unit] and |
---|
| 171 | _param->_table_issue_type [num_execute_loop][num_read_unit][type]) |
---|
| 172 | { |
---|
| 173 | log_printf(TRACE,Core_Glue,FUNCTION," * find !!!"); |
---|
| 174 | |
---|
| 175 | // find ! |
---|
| 176 | // Transaction |
---|
| 177 | READ_UNIT_ENABLE [num_execute_loop][num_read_unit] = false; // now, this read_unit is busy |
---|
| 178 | ISSUE_EXECUTE_LOOP_VAL [num_execute_loop][num_read_unit] = 1; // = val |
---|
| 179 | ISSUE_OOO_ENGINE_ACK [num_ooo_engine][num_inst_issue_queue] = 1; // = ack |
---|
| 180 | SLOT_ENABLE [num_ooo_engine][num_inst_issue_slot] = false; // now this slot is used |
---|
| 181 | |
---|
| 182 | if (_param->_have_port_context_id) |
---|
| 183 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CONTEXT_ID [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_CONTEXT_ID [num_ooo_engine][num_inst_issue_queue])); |
---|
| 184 | if (_param->_have_port_front_end_id) |
---|
| 185 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_FRONT_END_ID [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_FRONT_END_ID [num_ooo_engine][num_inst_issue_queue])); |
---|
| 186 | if (_param->_have_port_ooo_engine_id) |
---|
| 187 | { |
---|
| 188 | Tcontext_t ooo_engine_id = _param->_translate_num_ooo_engine_to_execute_loop_ooo_engine_id [num_ooo_engine][num_execute_loop]; |
---|
| 189 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OOO_ENGINE_ID [num_execute_loop][num_read_unit],ooo_engine_id); |
---|
| 190 | } |
---|
| 191 | if (_param->_have_port_rob_ptr) |
---|
| 192 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_PACKET_ID [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_PACKET_ID [num_ooo_engine][num_inst_issue_queue])); |
---|
| 193 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION [num_ooo_engine][num_inst_issue_queue])); |
---|
| 194 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE [num_execute_loop][num_read_unit],type); |
---|
| 195 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue])); |
---|
[122] | 196 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ [num_ooo_engine][num_inst_issue_queue])); |
---|
| 197 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY [num_ooo_engine][num_inst_issue_queue])); |
---|
[120] | 198 | if (_param->_have_port_load_queue_ptr) |
---|
| 199 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 200 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT [num_ooo_engine][num_inst_issue_queue])); |
---|
| 201 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT [num_ooo_engine][num_inst_issue_queue])); |
---|
| 202 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RA [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RA [num_ooo_engine][num_inst_issue_queue])); |
---|
| 203 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RA [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RA [num_ooo_engine][num_inst_issue_queue])); |
---|
| 204 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RB [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RB [num_ooo_engine][num_inst_issue_queue])); |
---|
| 205 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RB [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RB [num_ooo_engine][num_inst_issue_queue])); |
---|
| 206 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RC [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RC [num_ooo_engine][num_inst_issue_queue])); |
---|
| 207 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RC [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RC [num_ooo_engine][num_inst_issue_queue])); |
---|
| 208 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RD [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RD [num_ooo_engine][num_inst_issue_queue])); |
---|
| 209 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RD [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RD [num_ooo_engine][num_inst_issue_queue])); |
---|
| 210 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 211 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | find = true; |
---|
| 215 | break; |
---|
| 216 | } |
---|
| 217 | //if (find) |
---|
| 218 | // break; |
---|
| 219 | } |
---|
| 220 | if (find) |
---|
| 221 | break; |
---|
| 222 | } |
---|
| 223 | if (find) |
---|
| 224 | break; |
---|
| 225 | } |
---|
| 226 | |
---|
| 227 | if (_param->_issue_queue_in_order [num_ooo_engine] and |
---|
| 228 | not find and |
---|
| 229 | (num_inst_issue_queue >= _param->_nb_inst_reexecute [num_ooo_engine])) |
---|
[117] | 230 | { |
---|
[120] | 231 | log_printf(TRACE,Core_Glue,FUNCTION," * stop scan !!!"); |
---|
[117] | 232 | |
---|
[120] | 233 | break; // stop scan |
---|
[88] | 234 | } |
---|
[120] | 235 | } |
---|
| 236 | } |
---|
[88] | 237 | |
---|
| 238 | // Write output |
---|
| 239 | for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i) |
---|
[117] | 240 | for (uint32_t j=0; j<_param->_nb_inst_issue_queue[i]; ++j) |
---|
[88] | 241 | PORT_WRITE(out_ISSUE_OOO_ENGINE_ACK [i][j], ISSUE_OOO_ENGINE_ACK [i][j]); |
---|
| 242 | for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) |
---|
| 243 | for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j) |
---|
| 244 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_VAL [i][j], ISSUE_EXECUTE_LOOP_VAL [i][j]); |
---|
| 245 | |
---|
| 246 | log_end(Core_Glue,FUNCTION); |
---|
| 247 | }; |
---|
| 248 | |
---|
| 249 | }; // end namespace core_glue |
---|
| 250 | }; // end namespace core |
---|
| 251 | |
---|
| 252 | }; // end namespace behavioural |
---|
| 253 | }; // end namespace morpheo |
---|
| 254 | #endif |
---|
[117] | 255 | |
---|
| 256 | /* |
---|
| 257 | bool OOO_ENGINE_ENABLE [_param->_nb_ooo_engine ]; |
---|
| 258 | Tcontrol_t SLOT_ENABLE [_param->_nb_ooo_engine ][_param->_max_nb_inst_issue_slot]; |
---|
| 259 | bool READ_UNIT_ENABLE [_param->_nb_execute_loop][_param->_max_nb_read_unit]; |
---|
| 260 | |
---|
| 261 | // Init -> all at 0 |
---|
| 262 | for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i) |
---|
| 263 | { |
---|
| 264 | OOO_ENGINE_ENABLE [i] = true; |
---|
| 265 | |
---|
| 266 | for (uint32_t j=0; j<_param->_nb_inst_issue_slot[i]; ++j) |
---|
| 267 | SLOT_ENABLE [i][j] = 1; |
---|
| 268 | } |
---|
| 269 | |
---|
| 270 | for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) |
---|
| 271 | for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j) |
---|
| 272 | { |
---|
| 273 | // Read unit is enable is signal ack is set |
---|
| 274 | READ_UNIT_ENABLE [i][j] = (PORT_READ(in_ISSUE_EXECUTE_LOOP_ACK [i][j]) == 1); |
---|
| 275 | log_printf(TRACE,Core_Glue,FUNCTION," * Read_unit [%d][%d].enable : %d",i,j,READ_UNIT_ENABLE[i][j]); |
---|
| 276 | } |
---|
| 277 | |
---|
| 278 | |
---|
| 279 | // for each execute_loop |
---|
| 280 | for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) |
---|
| 281 | { |
---|
| 282 | // Scan all read_unit |
---|
| 283 | std::list<generic::priority::select_t> * select_read_unit = _priority_read_unit[i]->select(); |
---|
| 284 | for (std::list<generic::priority::select_t>::iterator it_read_unit=select_read_unit->begin(); |
---|
| 285 | it_read_unit!=select_read_unit->end(); |
---|
| 286 | ++it_read_unit) |
---|
| 287 | { |
---|
| 288 | // get the most priotary ... |
---|
| 289 | uint32_t num_read_unit = it_read_unit->grp; |
---|
| 290 | |
---|
| 291 | log_printf(TRACE,Core_Glue,FUNCTION," * read_unit [%d][%d]",i,num_read_unit); |
---|
| 292 | |
---|
| 293 | // ... and test if this read_unit is valid |
---|
| 294 | if (READ_UNIT_ENABLE [i][num_read_unit]) |
---|
| 295 | { |
---|
| 296 | bool find = false; |
---|
| 297 | |
---|
| 298 | // This read_unit is valid, now find an valid instruction |
---|
| 299 | // for each issue of each ooo_engine ... |
---|
| 300 | std::list<generic::priority::select_t> * select_ooo_engine = _priority_ooo_engine[i]->select(); |
---|
| 301 | for (std::list<generic::priority::select_t>::iterator it_ooo_engine=select_ooo_engine->begin(); |
---|
| 302 | it_ooo_engine!=select_ooo_engine->end(); |
---|
| 303 | ++it_ooo_engine) |
---|
| 304 | { |
---|
| 305 | // ... get id of the most priotary |
---|
| 306 | const uint32_t ooo_engine_id = it_ooo_engine->grp; |
---|
| 307 | const uint32_t num_ooo_engine = _param->_translate_execute_loop_num_ooo_engine [i][ooo_engine_id]; |
---|
| 308 | const uint32_t num_inst_issue_slot = it_ooo_engine->elt; |
---|
| 309 | |
---|
| 310 | log_printf(TRACE,Core_Glue,FUNCTION," * num_ooo_engine [%d (%d)][%d]",num_ooo_engine, ooo_engine_id,num_inst_issue_slot); |
---|
| 311 | |
---|
| 312 | if (OOO_ENGINE_ENABLE [num_ooo_engine] and SLOT_ENABLE [num_ooo_engine][num_inst_issue_slot]) |
---|
| 313 | { |
---|
| 314 | uint32_t num_inst_issue_queue = 0; |
---|
| 315 | for (; num_inst_issue_queue < _param->_nb_inst_issue_queue [num_ooo_engine]; num_inst_issue_queue ++) |
---|
| 316 | { |
---|
| 317 | // Test if this instruction is not previously send at a read_unit |
---|
| 318 | if (not ISSUE_OOO_ENGINE_ACK [num_ooo_engine][num_inst_issue_queue]) |
---|
| 319 | { |
---|
| 320 | Tcontrol_t ooo_engine_val = PORT_READ(in_ISSUE_OOO_ENGINE_VAL [num_ooo_engine][num_inst_issue_queue]); |
---|
| 321 | Ttype_t type = PORT_READ(in_ISSUE_OOO_ENGINE_TYPE [num_ooo_engine][num_inst_issue_queue]); |
---|
| 322 | // Test if have an link and read unit is enable |
---|
| 323 | bool can_dispatch = _param->_table_dispatch [num_ooo_engine][num_inst_issue_slot][i][num_read_unit]; |
---|
| 324 | bool can_issue_type = _param->_table_issue_type [i][num_read_unit][type]; |
---|
| 325 | |
---|
| 326 | log_printf(TRACE,Core_Glue,FUNCTION," * num_ooo_engine_queue : %d",num_inst_issue_queue); |
---|
| 327 | log_printf(TRACE,Core_Glue,FUNCTION," * type : %s",toString(type).c_str()); |
---|
| 328 | log_printf(TRACE,Core_Glue,FUNCTION," * ISSUE_OOO_ENGINE_VAL : %d",ooo_engine_val); |
---|
| 329 | log_printf(TRACE,Core_Glue,FUNCTION," * table_dispatch : %d",can_dispatch); |
---|
| 330 | log_printf(TRACE,Core_Glue,FUNCTION," * table_issue_type : %d",can_issue_type); |
---|
| 331 | |
---|
| 332 | |
---|
| 333 | // test if have a request ? |
---|
| 334 | // and test if have a link between the issue slot and read_unit |
---|
| 335 | // and if the read_unit accept this instruction's type |
---|
| 336 | if (ooo_engine_val and |
---|
| 337 | can_dispatch and |
---|
| 338 | can_issue_type) |
---|
| 339 | { |
---|
| 340 | // log_printf(TRACE,Core_Glue,FUNCTION," * find !!!"); |
---|
| 341 | |
---|
| 342 | // Transaction |
---|
| 343 | READ_UNIT_ENABLE [i][num_read_unit] = false; // now, this read_unit is busy |
---|
| 344 | ISSUE_EXECUTE_LOOP_VAL [i][num_read_unit] = ooo_engine_val; |
---|
| 345 | ISSUE_OOO_ENGINE_ACK [num_ooo_engine][num_inst_issue_queue] = 1; |
---|
| 346 | SLOT_ENABLE [num_ooo_engine][num_inst_issue_slot] = 0; // now this slot is used |
---|
| 347 | |
---|
| 348 | if (_param->_have_port_context_id) |
---|
| 349 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CONTEXT_ID [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_CONTEXT_ID [num_ooo_engine][num_inst_issue_queue])); |
---|
| 350 | if (_param->_have_port_front_end_id) |
---|
| 351 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_FRONT_END_ID [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_FRONT_END_ID [num_ooo_engine][num_inst_issue_queue])); |
---|
| 352 | if (_param->_have_port_ooo_engine_id) |
---|
| 353 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OOO_ENGINE_ID [i][num_read_unit],ooo_engine_id); |
---|
| 354 | if (_param->_have_port_rob_ptr) |
---|
| 355 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_PACKET_ID [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_PACKET_ID [num_ooo_engine][num_inst_issue_queue])); |
---|
| 356 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION [num_ooo_engine][num_inst_issue_queue])); |
---|
| 357 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE [i][num_read_unit],type); |
---|
| 358 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 359 | if (_param->_have_port_load_queue_ptr) |
---|
| 360 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 361 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT [num_ooo_engine][num_inst_issue_queue])); |
---|
| 362 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT [num_ooo_engine][num_inst_issue_queue])); |
---|
| 363 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RA [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RA [num_ooo_engine][num_inst_issue_queue])); |
---|
| 364 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RA [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RA [num_ooo_engine][num_inst_issue_queue])); |
---|
| 365 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RB [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RB [num_ooo_engine][num_inst_issue_queue])); |
---|
| 366 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RB [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RB [num_ooo_engine][num_inst_issue_queue])); |
---|
| 367 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RC [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RC [num_ooo_engine][num_inst_issue_queue])); |
---|
| 368 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RC [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RC [num_ooo_engine][num_inst_issue_queue])); |
---|
| 369 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RD [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RD [num_ooo_engine][num_inst_issue_queue])); |
---|
| 370 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RD [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RD [num_ooo_engine][num_inst_issue_queue])); |
---|
| 371 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RE [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 372 | PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RE [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RE [num_ooo_engine][num_inst_issue_queue])); |
---|
| 373 | |
---|
| 374 | find = true;// find : stop scan read_unit |
---|
| 375 | } |
---|
| 376 | } |
---|
| 377 | if (find) |
---|
| 378 | break; |
---|
| 379 | } |
---|
| 380 | |
---|
| 381 | if (find) |
---|
| 382 | { |
---|
| 383 | log_printf(TRACE,Core_Glue,FUNCTION," * find !!!"); |
---|
| 384 | break; |
---|
| 385 | } |
---|
| 386 | else |
---|
| 387 | { |
---|
| 388 | log_printf(TRACE,Core_Glue,FUNCTION," * not find !!!"); |
---|
| 389 | log_printf(TRACE,Core_Glue,FUNCTION," * issue_queue_in_order: %d",_param->_issue_queue_in_order [num_ooo_engine]); |
---|
| 390 | log_printf(TRACE,Core_Glue,FUNCTION," * num_inst_issue_queue: %d",num_inst_issue_queue); |
---|
| 391 | log_printf(TRACE,Core_Glue,FUNCTION," * nb_inst_reexecute : %d",_param->_nb_inst_reexecute [num_ooo_engine]); |
---|
| 392 | |
---|
| 393 | if (_param->_issue_queue_in_order [num_ooo_engine] and |
---|
| 394 | (num_inst_issue_queue >= _param->_nb_inst_reexecute [num_ooo_engine])) |
---|
| 395 | OOO_ENGINE_ENABLE [num_ooo_engine] = false; |
---|
| 396 | } |
---|
| 397 | } |
---|
| 398 | } |
---|
| 399 | } |
---|
| 400 | } |
---|
| 401 | } |
---|
| 402 | */ |
---|
| 403 | |
---|