Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_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/Decod_unit/Decod_queue/src/Decod_queue_transition.cpp
r87 r88 23 23 { 24 24 log_begin(Decod_queue,FUNCTION); 25 log_function(Decod_queue,FUNCTION,_name.c_str()); 25 26 26 27 if (PORT_READ(in_NRESET) == 0) … … 35 36 //-------------------------------------------------------------------- 36 37 //-----[ DECOD_IN ]--------------------------------------------------- 37 //-------------------------------------------------------------------- 38 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 38 //-------------------------------------------------------------------- 39 decod_queue_entry_t * entry = NULL; 40 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 39 41 { 40 decod_queue_entry_t * entry = NULL;41 42 if (PORT_READ(in_DECOD_IN_VAL [i]) and internal_DECOD_IN_ACK[i]) 42 43 { 43 log_printf(TRACE,Decod_queue,FUNCTION,_(" DECOD_IN [%d]"),i);44 log_printf(TRACE,Decod_queue,FUNCTION,_(" * DECOD_IN [%d]"),i); 44 45 45 46 if (entry == NULL) 46 entry = new decod_queue_entry_t (_param->_nb_inst_decod); 47 { 48 // Once creation and insert in queue 49 entry = new decod_queue_entry_t (_param->_nb_inst_decod); 50 reg_QUEUE->push_back(entry); 51 } 47 52 48 53 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_IN_CONTEXT_ID [i]):0; 49 54 50 log_printf(TRACE,Decod_queue,FUNCTION,_(" * context : %d"),context);55 log_printf(TRACE,Decod_queue,FUNCTION,_(" * context : %d"),context); 51 56 52 57 entry->_val [i] = 1; … … 55 60 entry->_type [i] = PORT_READ(in_DECOD_IN_TYPE [i]); 56 61 entry->_operation [i] = PORT_READ(in_DECOD_IN_OPERATION [i]); 62 entry->_no_execute [i] = PORT_READ(in_DECOD_IN_NO_EXECUTE [i]); 57 63 entry->_is_delay_slot [i] = PORT_READ(in_DECOD_IN_IS_DELAY_SLOT [i]); 58 64 entry->_address [i] = PORT_READ(in_DECOD_IN_ADDRESS [i]); … … 70 76 entry->_num_reg_re [i] = PORT_READ(in_DECOD_IN_NUM_REG_RE [i]); 71 77 entry->_exception_use [i] = PORT_READ(in_DECOD_IN_EXCEPTION_USE [i]); 78 entry->_exception [i] = PORT_READ(in_DECOD_IN_EXCEPTION [i]); 72 79 73 80 reg_NB_INST [context] ++; 74 reg_QUEUE->push_back(entry);75 81 76 log_printf(TRACE,Decod_queue,FUNCTION,_(" * nb_inst : %d"),reg_NB_INST [context]);77 log_printf(TRACE,Decod_queue,FUNCTION,_(" * PUSH queue"));82 log_printf(TRACE,Decod_queue,FUNCTION,_(" * nb_inst : %d"),reg_NB_INST [context]); 83 log_printf(TRACE,Decod_queue,FUNCTION,_(" * PUSH queue")); 78 84 } 79 85 } … … 91 97 if (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i]) 92 98 { 93 log_printf(TRACE,Decod_queue,FUNCTION,_(" DECOD_OUT [%d]"),i);99 log_printf(TRACE,Decod_queue,FUNCTION,_(" * DECOD_OUT [%d]"),i); 94 100 95 101 reg_QUEUE->front()->_val [i] = 0; 96 102 97 103 Tcontext_t context = reg_QUEUE->front()->_context_id [i]; 98 log_printf(TRACE,Decod_queue,FUNCTION,_(" * context : %d"),context);104 log_printf(TRACE,Decod_queue,FUNCTION,_(" * context : %d"),context); 99 105 100 106 reg_NB_INST [context] --; 101 log_printf(TRACE,Decod_queue,FUNCTION,_(" * nb_inst : %d"),reg_NB_INST [context]);107 log_printf(TRACE,Decod_queue,FUNCTION,_(" * nb_inst : %d"),reg_NB_INST [context]); 102 108 } 103 109 // Test if slot is (again) valid, if yes, then have less one instruction in the entry … … 108 114 if (not find) // no valid instruction in current slot 109 115 { 110 log_printf(TRACE,Decod_queue,FUNCTION,_(" * POP queue"));116 log_printf(TRACE,Decod_queue,FUNCTION,_(" * POP queue")); 111 117 112 118 // can pop the slot … … 117 123 } 118 124 119 #if (DEBUG >= DEBUG_TRACE) and (DEBUG_Decod_queue) 125 #if defined(DEBUG) and defined(DEBUG_Decod_queue) and (DEBUG >= DEBUG_TRACE) 126 log_printf(TRACE,Decod_queue,FUNCTION," * Dump decod_queue"); 120 127 uint32_t x=0; 121 128 for (std::list<decod_queue_entry_t*>::iterator it=reg_QUEUE->begin(); … … 123 130 it++) 124 131 { 125 log_printf(TRACE,Decod_queue,FUNCTION," [%d] ",x);132 log_printf(TRACE,Decod_queue,FUNCTION," * [%d] ",x); 126 133 127 134 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 128 135 { 129 136 if ((*it)->_val [i]) 130 log_printf(TRACE,Decod_queue,FUNCTION," * [%d] %d, %d %d, %d %d %d, 0x%x, %d 0x%x, %d %d, %d %d, %d %d, %d %d, %d %d, %d"137 log_printf(TRACE,Decod_queue,FUNCTION," * [%d] %d, %d %d, %d %d %d %d, 0x%x, %d 0x%x, %d %d, %d %d, %d %d, %d %d, %d %d, %d %d" 131 138 ,i 132 139 ,(*it)->_val [i] … … 135 142 ,(*it)->_type [i] 136 143 ,(*it)->_operation [i] 144 ,(*it)->_no_execute [i] 137 145 ,(*it)->_is_delay_slot [i] 138 146 ,(*it)->_address [i] … … 150 158 ,(*it)->_num_reg_re [i] 151 159 ,(*it)->_exception_use [i] 160 ,(*it)->_exception [i] 152 161 ); 153 162 else 154 log_printf(TRACE,Decod_queue,FUNCTION," * [%d] %d"163 log_printf(TRACE,Decod_queue,FUNCTION," * [%d] %d" 155 164 ,i 156 165 ,(*it)->_val [i] … … 163 172 164 173 #ifdef STATISTICS 165 for (uint32_t i=0; i<_param->_nb_context; i++) 166 *(_stat_nb_inst [i]) += reg_NB_INST [i]; 174 if (usage_is_set(_usage,USE_STATISTICS)) 175 { 176 *(_stat_use_queue) += reg_QUEUE->size(); 177 for (uint32_t i=0; i<_param->_nb_context; i++) 178 *(_stat_nb_inst [i]) += reg_NB_INST [i]; 179 } 167 180 #endif 168 181
Note: See TracChangeset
for help on using the changeset viewer.