Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_transition.cpp
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_transition.cpp
r85 r88 22 22 void Ifetch_queue::transition (void) 23 23 { 24 log_ printf(FUNC,Ifetch_queue,FUNCTION,"Begin");24 log_begin(Ifetch_queue,FUNCTION); 25 25 26 26 if (PORT_READ(in_NRESET) == 0) … … 34 34 else 35 35 { 36 log_printf(NONE,Ifetch_queue,FUNCTION," * KANE address : 0x%x",PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS));37 38 39 36 // ========================================================== 40 37 // =====[ ADDRESS ]========================================== … … 47 44 48 45 #ifdef STATISTICS 49 (*_sum_transaction_address) ++; 46 if (usage_is_set(_usage,USE_STATISTICS)) 47 (*_sum_transaction_address) ++; 50 48 #endif 51 49 … … 54 52 Tcontrol_t enable = PORT_READ(in_ADDRESS_INSTRUCTION_ENABLE [i]); 55 53 #ifdef STATISTICS 56 (*_sum_inst_enable) += enable; 54 if (usage_is_set(_usage,USE_STATISTICS)) 55 (*_sum_inst_enable) += enable; 57 56 #endif 58 57 _queue[reg_PTR_WRITE]->_instruction_enable [i] = enable; … … 60 59 61 60 _queue[reg_PTR_WRITE]->_address = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS ); 62 _queue[reg_PTR_WRITE]->_inst_ifetch_ptr = (_param->_have_port_inst ruction_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR ):0;61 _queue[reg_PTR_WRITE]->_inst_ifetch_ptr = (_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR ):0; 63 62 _queue[reg_PTR_WRITE]->_branch_state = PORT_READ(in_ADDRESS_BRANCH_STATE ); 64 _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_ branch_update_prediction_id)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0;63 _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_depth)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0; 65 64 66 65 reg_PTR_WRITE = (reg_PTR_WRITE+1)%_param->_size_queue; … … 95 94 if (PORT_READ(in_ICACHE_RSP_VAL) and internal_ICACHE_RSP_ACK) 96 95 { 97 Tpacket_t ptr = (_param->_have_port_ queue_ptr)?PORT_READ(in_ICACHE_RSP_PACKET_ID):0;96 Tpacket_t ptr = (_param->_have_port_ifetch_queue_ptr)?PORT_READ(in_ICACHE_RSP_PACKET_ID):0; 98 97 99 98 for (uint32_t i=0; i<_param->_nb_instruction; i++) … … 137 136 } 138 137 139 #if DEBUG >= DEBUG_TRACE140 log_printf(TRACE,Ifetch_queue,FUNCTION," Dump ifetch_queue");141 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_WRITE : %d",reg_PTR_WRITE);142 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_READ : %d",reg_PTR_READ );138 #if defined(DEBUG) and (DEBUG >= DEBUG_TRACE) 139 log_printf(TRACE,Ifetch_queue,FUNCTION," * Dump ifetch_queue"); 140 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_WRITE : %d",reg_PTR_WRITE); 141 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_READ : %d",reg_PTR_READ ); 143 142 for (uint32_t i=0; i<_param->_size_queue; i++) 144 143 { 145 log_printf(TRACE,Ifetch_queue,FUNCTION,"* [%d] %s %.8x %d - %d %d %d", i, toString(_queue [i]->_state).c_str(), _queue [i]->_address,_queue [i]->_inst_ifetch_ptr,_queue [i]->_branch_state,_queue [i]->_branch_update_prediction_id,_queue [i]->_exception);144 log_printf(TRACE,Ifetch_queue,FUNCTION," * [%d] %s %.8x %d - %d %d %d", i, toString(_queue [i]->_state).c_str(), _queue [i]->_address,_queue [i]->_inst_ifetch_ptr,_queue [i]->_branch_state,_queue [i]->_branch_update_prediction_id,_queue [i]->_exception); 146 145 147 146 for (uint32_t j=0; j<_param->_nb_instruction; j++) 148 log_printf(TRACE,Ifetch_queue,FUNCTION," * %d %.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]);147 log_printf(TRACE,Ifetch_queue,FUNCTION," * %d %.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]); 149 148 } 150 149 #endif 151 150 152 151 #ifdef STATISTICS 153 for (uint32_t i=0; i<_param->_size_queue; i++) 154 switch (_queue[i]->_state) 155 { 156 case IFETCH_QUEUE_STATE_EMPTY : break; 157 case IFETCH_QUEUE_STATE_WAIT_RSP : (*_sum_use_queue_wait_rsp ) ++; break; 158 case IFETCH_QUEUE_STATE_HAVE_RSP : (*_sum_use_queue_have_rsp ) ++; break; 159 case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : (*_sum_use_queue_error_wait_rsp) ++; break; 160 default : break; 161 } 152 if (usage_is_set(_usage,USE_STATISTICS)) 153 for (uint32_t i=0; i<_param->_size_queue; i++) 154 switch (_queue[i]->_state) 155 { 156 case IFETCH_QUEUE_STATE_EMPTY : break; 157 case IFETCH_QUEUE_STATE_WAIT_RSP : (*_sum_use_queue_wait_rsp ) ++; break; 158 case IFETCH_QUEUE_STATE_HAVE_RSP : (*_sum_use_queue_have_rsp ) ++; break; 159 case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : (*_sum_use_queue_error_wait_rsp) ++; break; 160 default : break; 161 } 162 162 #endif 163 163 } 164 164 165 165 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 166 166 end_cycle (); 167 167 #endif 168 168 169 log_ printf(FUNC,Ifetch_queue,FUNCTION,"End");169 log_end(Ifetch_queue,FUNCTION); 170 170 }; 171 171
Note: See TracChangeset
for help on using the changeset viewer.