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