Changeset 110 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp
- Timestamp:
- Feb 19, 2009, 5:31:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp
r109 r110 32 32 for (uint32_t i=0; i<_param->_nb_bank; i++) 33 33 _issue_queue [i].clear(); 34 _reexecute_queue.clear(); 34 35 } 35 36 else … … 42 43 // =====[ ISSUE_IN ]================================================== 43 44 // =================================================================== 45 44 46 for (uint32_t i=0; i<_param->_nb_bank; i++) 45 47 if (internal_BANK_IN_ACK [i]) 46 48 { 47 entry_t * entry = NULL; 48 49 if (internal_BANK_IN_IS_REEXECUTE [i]) 50 { 51 uint32_t y = internal_BANK_IN_NUM_INST [i]; 52 53 if (PORT_READ(in_REEXECUTE_VAL [y])) 54 { 55 log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_IN [%d] - Transaction with REEXECUTE [%d]",i,y); 49 uint32_t x = internal_BANK_IN_NUM_RENAME_UNIT [i]; 50 uint32_t y = internal_BANK_IN_NUM_INST [i]; 51 52 if (PORT_READ(in_ISSUE_IN_VAL[x][y])) 53 { 54 log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_IN [%d] - Transaction with ISSUE_IN [%d][%d]",i,x,y); 55 56 56 #ifdef STATISTICS 57 if (usage_is_set(_usage,USE_STATISTICS)) 58 (*_stat_nb_inst_reexecute) ++; 59 #endif 60 entry = new entry_t 61 ( 62 (_param->_have_port_context_id )?PORT_READ(in_REEXECUTE_CONTEXT_ID [y]):0, 63 (_param->_have_port_front_end_id )?PORT_READ(in_REEXECUTE_FRONT_END_ID [y]):0, 64 (_param->_have_port_rob_ptr )?PORT_READ(in_REEXECUTE_PACKET_ID [y]):0, 65 PORT_READ(in_REEXECUTE_OPERATION [y]), 66 PORT_READ(in_REEXECUTE_TYPE [y]), 67 PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [y]), 68 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE [y]):0, 69 PORT_READ(in_REEXECUTE_HAS_IMMEDIAT [y]), 70 PORT_READ(in_REEXECUTE_IMMEDIAT [y]), 71 PORT_READ(in_REEXECUTE_READ_RA [y]), 72 PORT_READ(in_REEXECUTE_NUM_REG_RA [y]), 73 PORT_READ(in_REEXECUTE_READ_RB [y]), 74 PORT_READ(in_REEXECUTE_NUM_REG_RB [y]), 75 PORT_READ(in_REEXECUTE_READ_RC [y]), 76 PORT_READ(in_REEXECUTE_NUM_REG_RC [y]), 77 PORT_READ(in_REEXECUTE_WRITE_RD [y]), 78 PORT_READ(in_REEXECUTE_NUM_REG_RD [y]), 79 PORT_READ(in_REEXECUTE_WRITE_RE [y]), 80 PORT_READ(in_REEXECUTE_NUM_REG_RE [y]) 81 ); 82 } 83 } 84 else 85 { 86 uint32_t x = internal_BANK_IN_NUM_RENAME_UNIT [i]; 87 uint32_t y = internal_BANK_IN_NUM_INST [i]; 88 89 if (PORT_READ(in_ISSUE_IN_VAL[x][y])) 90 { 91 log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_IN [%d] - Transaction with ISSUE_IN [%d][%d]",i,x,y); 92 57 if (usage_is_set(_usage,USE_STATISTICS)) 58 (*_stat_nb_inst_issue_in [x]) ++; 59 #endif 60 entry_t * entry = new entry_t 61 ( 62 (_param->_have_port_context_id )?PORT_READ(in_ISSUE_IN_CONTEXT_ID [x][y]):0, 63 (_param->_have_port_front_end_id )?PORT_READ(in_ISSUE_IN_FRONT_END_ID [x][y]):0, 64 (_param->_have_port_rob_ptr )?PORT_READ(in_ISSUE_IN_PACKET_ID [x][y]):0, 65 PORT_READ(in_ISSUE_IN_OPERATION [x][y]), 66 PORT_READ(in_ISSUE_IN_TYPE [x][y]), 67 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [x][y]), 68 (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE [x][y]):0, 69 PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT [x][y]), 70 PORT_READ(in_ISSUE_IN_IMMEDIAT [x][y]), 71 PORT_READ(in_ISSUE_IN_READ_RA [x][y]), 72 PORT_READ(in_ISSUE_IN_NUM_REG_RA [x][y]), 73 PORT_READ(in_ISSUE_IN_READ_RB [x][y]), 74 PORT_READ(in_ISSUE_IN_NUM_REG_RB [x][y]), 75 PORT_READ(in_ISSUE_IN_READ_RC [x][y]), 76 PORT_READ(in_ISSUE_IN_NUM_REG_RC [x][y]), 77 PORT_READ(in_ISSUE_IN_WRITE_RD [x][y]), 78 PORT_READ(in_ISSUE_IN_NUM_REG_RD [x][y]), 79 PORT_READ(in_ISSUE_IN_WRITE_RE [x][y]), 80 PORT_READ(in_ISSUE_IN_NUM_REG_RE [x][y]) 81 ); 82 83 _issue_queue [i].push_back(entry); 84 } 85 } 86 87 // =================================================================== 88 // =====[ REEXECUTE_UNIT ]============================================ 89 // =================================================================== 90 91 for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i) 92 if (PORT_READ(in_REEXECUTE_VAL [i]) and internal_REEXECUTE_ACK [i]) 93 { 94 log_printf(TRACE,Issue_queue,FUNCTION," * REEXECUTE [%d]",i); 93 95 #ifdef STATISTICS 94 if (usage_is_set(_usage,USE_STATISTICS)) 95 (*_stat_nb_inst_issue_in [x]) ++; 96 #endif 97 entry = new entry_t 98 ( 99 (_param->_have_port_context_id )?PORT_READ(in_ISSUE_IN_CONTEXT_ID [x][y]):0, 100 (_param->_have_port_front_end_id )?PORT_READ(in_ISSUE_IN_FRONT_END_ID [x][y]):0, 101 (_param->_have_port_rob_ptr )?PORT_READ(in_ISSUE_IN_PACKET_ID [x][y]):0, 102 PORT_READ(in_ISSUE_IN_OPERATION [x][y]), 103 PORT_READ(in_ISSUE_IN_TYPE [x][y]), 104 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [x][y]), 105 (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE [x][y]):0, 106 PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT [x][y]), 107 PORT_READ(in_ISSUE_IN_IMMEDIAT [x][y]), 108 PORT_READ(in_ISSUE_IN_READ_RA [x][y]), 109 PORT_READ(in_ISSUE_IN_NUM_REG_RA [x][y]), 110 PORT_READ(in_ISSUE_IN_READ_RB [x][y]), 111 PORT_READ(in_ISSUE_IN_NUM_REG_RB [x][y]), 112 PORT_READ(in_ISSUE_IN_READ_RC [x][y]), 113 PORT_READ(in_ISSUE_IN_NUM_REG_RC [x][y]), 114 PORT_READ(in_ISSUE_IN_WRITE_RD [x][y]), 115 PORT_READ(in_ISSUE_IN_NUM_REG_RD [x][y]), 116 PORT_READ(in_ISSUE_IN_WRITE_RE [x][y]), 117 PORT_READ(in_ISSUE_IN_NUM_REG_RE [x][y]) 118 ); 119 } 120 } 121 122 if (entry != NULL) 123 _issue_queue [i].push_back(entry); 124 } 96 if (usage_is_set(_usage,USE_STATISTICS)) 97 (*_stat_nb_inst_reexecute) ++; 98 #endif 99 entry_t * entry = new entry_t 100 ( 101 (_param->_have_port_context_id )?PORT_READ(in_REEXECUTE_CONTEXT_ID [i]):0, 102 (_param->_have_port_front_end_id )?PORT_READ(in_REEXECUTE_FRONT_END_ID [i]):0, 103 (_param->_have_port_rob_ptr )?PORT_READ(in_REEXECUTE_PACKET_ID [i]):0, 104 PORT_READ(in_REEXECUTE_OPERATION [i]), 105 PORT_READ(in_REEXECUTE_TYPE [i]), 106 PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [i]), 107 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE [i]):0, 108 PORT_READ(in_REEXECUTE_HAS_IMMEDIAT [i]), 109 PORT_READ(in_REEXECUTE_IMMEDIAT [i]), 110 PORT_READ(in_REEXECUTE_READ_RA [i]), 111 PORT_READ(in_REEXECUTE_NUM_REG_RA [i]), 112 PORT_READ(in_REEXECUTE_READ_RB [i]), 113 PORT_READ(in_REEXECUTE_NUM_REG_RB [i]), 114 PORT_READ(in_REEXECUTE_READ_RC [i]), 115 PORT_READ(in_REEXECUTE_NUM_REG_RC [i]), 116 PORT_READ(in_REEXECUTE_WRITE_RD [i]), 117 PORT_READ(in_REEXECUTE_NUM_REG_RD [i]), 118 PORT_READ(in_REEXECUTE_WRITE_RE [i]), 119 PORT_READ(in_REEXECUTE_NUM_REG_RE [i]) 120 ); 121 122 _reexecute_queue.push_back(entry); 123 } 125 124 126 125 // =================================================================== 127 126 // =====[ ISSUE_OUT ]================================================= 128 127 // =================================================================== 129 for (uint32_t i=0; i<_param->_nb_bank; i++) 130 { 131 // log_printf(TRACE,Issue_queue,FUNCTION," * internal_BANK_OUT [%d] val %d, num_inst %d",i,internal_BANK_OUT_VAL [i],internal_BANK_OUT_NUM_INST [i]); 132 133 if (internal_BANK_OUT_VAL [i]) 134 { 135 #ifdef STATISTICS 136 if (usage_is_set(_usage,USE_STATISTICS)) 137 (*_stat_nb_inst_issue_out) ++; 138 #endif 139 140 uint32_t x = internal_BANK_OUT_NUM_INST [i]; 141 // log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_OUT_ACK : %d",PORT_READ(in_ISSUE_OUT_ACK [x])); 142 143 if (PORT_READ(in_ISSUE_OUT_ACK [x])) 144 { 145 log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_OUT [%d] - Transaction with ISSUE_OUT [%d]",i,x); 146 147 148 entry_t * entry = _issue_queue [i].front(); 149 _issue_queue [i].pop_front(); 150 delete entry; 151 } 152 } 153 } 128 129 for (uint32_t i=0; i<_param->_nb_inst_issue; ++i) 130 if (internal_ISSUE_OUT_VAL [i] and PORT_READ(in_ISSUE_OUT_ACK [i])) 131 { 132 entry_t * entry = internal_ISSUE_OUT_ENTRY [i]; 133 134 if (internal_ISSUE_OUT_FROM_REEXECUTE [i]) 135 { 136 log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_OUT [%d] - From Reexecute_queue",i); 137 138 _reexecute_queue.remove(entry); 139 } 140 else 141 { 142 // front ... 143 uint32_t num_bank = internal_ISSUE_OUT_NUM_BANK [i]; 144 145 log_printf(TRACE,Issue_queue,FUNCTION," * ISSUE_OUT [%d] - From issue_queue [%d]",i,num_bank); 146 147 _issue_queue [num_bank].remove(entry); 148 } 149 150 delete entry; 151 } 154 152 } 155 153 154 #if defined(DEBUG) and defined(DEBUG_Issue_queue) and (DEBUG >= DEBUG_TRACE) 156 155 log_printf(TRACE,Issue_queue,FUNCTION," * Dump Issue_queue"); 156 157 157 for (uint32_t i=0; i<_param->_nb_bank; i++) 158 158 { 159 #ifdef STATISTICS160 if (usage_is_set(_usage,USE_STATISTICS))161 *(_stat_bank_nb_inst [i]) += _issue_queue[i].size();162 #endif163 159 log_printf(TRACE,Issue_queue,FUNCTION," * Bank [%d] size : %d",i,(int)_issue_queue[i].size()); 164 160 … … 199 195 ++j; 200 196 } 201 202 197 } 198 199 { 200 log_printf(TRACE,Issue_queue,FUNCTION," * Reexecute_queue - size : %d",(int)_reexecute_queue.size()); 201 202 uint32_t i = 0; 203 204 for (std::list<entry_t*>::iterator it=_reexecute_queue.begin();it!=_reexecute_queue.end(); ++it) 205 { 206 log_printf(TRACE,Issue_queue,FUNCTION," [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d", 207 i, 208 209 (*it)->_context_id , 210 (*it)->_front_end_id , 211 (*it)->_packet_id , 212 213 (*it)->_type , 214 (*it)->_operation , 215 216 (*it)->_store_queue_ptr_write, 217 (*it)->_load_queue_ptr_write , 218 219 (*it)->_has_immediat , 220 (*it)->_immediat , 221 222 (*it)->_read_ra , 223 (*it)->_num_reg_ra , 224 225 (*it)->_read_rb , 226 (*it)->_num_reg_rb , 227 228 (*it)->_read_rc , 229 (*it)->_num_reg_rc , 230 231 (*it)->_write_rd , 232 (*it)->_num_reg_rd , 233 234 (*it)->_write_re , 235 (*it)->_num_reg_re ); 236 ++i; 237 } 238 } 239 #endif 240 241 #ifdef STATISTICS 242 if (usage_is_set(_usage,USE_STATISTICS)) 243 for (uint32_t i=0; i<_param->_nb_bank; i++) 244 *(_stat_bank_nb_inst [i]) += _issue_queue[i].size(); 245 #endif 203 246 204 247 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
Note: See TracChangeset
for help on using the changeset viewer.