Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp
r87 r88 22 22 void Decod::genMealy (void) 23 23 { 24 log_printf(TRACE,Decod,FUNCTION,"Begin"); 24 log_begin(Decod,FUNCTION); 25 log_function(Decod,FUNCTION,_name.c_str()); 25 26 26 27 //----------------------------------- … … 38 39 { 39 40 decod_val [i] = false; 41 predict_val [i] = false; 40 42 } 41 43 … … 57 59 //----------------------------------- 58 60 // scan all decod "slot_out" 59 log_printf(TRACE,Decod,FUNCTION,"KANE LIVE");60 std::list< select_t>::iterator it=select.begin();61 std::list<generic::priority::select_t> * select = _priority->select(); 62 std::list<generic::priority::select_t>::iterator it=select->begin(); 61 63 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 62 64 { 63 while ((it != select .end())and // have a no scanned "slot_in" ?65 while ((it != select->end()) and // have a no scanned "slot_in" ? 64 66 (decod_val [i] == false) and // have not a previous selected entry? 65 67 (context_event_val == false)) // Have not a context_event (spr_access, exception, ...) 66 68 { 67 log_printf(TRACE,Decod,FUNCTION,"loop");68 69 69 predict_val [i] = false; 70 70 71 Tcontext_t x = it-> _context;72 uint32_t y = it-> _inst_fetch;71 Tcontext_t x = it->grp; 72 uint32_t y = it->elt; 73 73 74 74 // Test if this instruction is valid … … 76 76 (can_continue [x] == 1)) // context can decod instruction (have not a previous event) 77 77 { 78 can_continue [x] = can_continue_next [x]; 78 log_printf(TRACE,Decod,FUNCTION," * IFETCH [%d][%d]",x,y); 79 80 can_continue [x] = can_continue_next [x]; 79 81 80 82 decod_val [i] = true; // fetch_val and decod_enable … … 90 92 _decod_instruction->_is_delay_slot = internal_CONTEXT_IS_DELAY_SLOT [x]; 91 93 92 // Decod ! 93 log_printf(TRACE,Decod,FUNCTION,"DECOD [%d]",i); 94 log_printf(TRACE,Decod,FUNCTION," * context : %d",x); 95 log_printf(TRACE,Decod,FUNCTION," * fetch : %d",y); 96 log_printf(TRACE,Decod,FUNCTION," * address : %.8x",addr); 97 log_printf(TRACE,Decod,FUNCTION," * is_delay_slot : %d",internal_CONTEXT_IS_DELAY_SLOT [x]); 98 99 instruction_decod (_decod_instruction, _decod_param[x]); 100 101 Ttype_t type = _decod_instruction->_type; 94 // Test IFetch exception 95 Texception_t ifetch_exception = PORT_READ(in_IFETCH_EXCEPTION [x]); 96 97 if (ifetch_exception == EXCEPTION_IFETCH_NONE) 98 { 99 // Decod ! 100 log_printf(TRACE,Decod,FUNCTION," * DECOD [%d]",i); 101 log_printf(TRACE,Decod,FUNCTION," * context : %d",x); 102 log_printf(TRACE,Decod,FUNCTION," * fetch : %d",y); 103 log_printf(TRACE,Decod,FUNCTION," * address : %.8x (%.8x)",addr,(addr<<2)); 104 log_printf(TRACE,Decod,FUNCTION," * is_delay_slot : %d",internal_CONTEXT_IS_DELAY_SLOT [x]); 105 106 instruction_decod (_decod_instruction, _decod_param[x]); 107 } 108 else 109 { 110 // No decod : nop 111 instruction_l_nop (_decod_instruction, _decod_param[x]); 112 113 _decod_instruction->_exception_use = EXCEPTION_USE_NONE; 114 _decod_instruction->_exception = exception_ifetch_to_exception_decod(ifetch_exception); 115 116 // INSTRUCTION_TLB 117 // INSTRUCTION_PAGE 118 // BUS_ERROR 119 if (_decod_instruction->_is_delay_slot) 120 _decod_instruction->_address_next = _decod_instruction->_address_previous; 121 else 122 _decod_instruction->_address_next = _decod_instruction->_address; 123 124 _decod_instruction->_event_type = EVENT_TYPE_EXCEPTION; 125 } 126 127 Ttype_t type = _decod_instruction->_type; 128 Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_CONTEXT_DEPTH [x]):0; // DEPTH_CURRENT 102 129 103 130 if (_param->_have_port_context_id) 104 131 PORT_WRITE(out_DECOD_CONTEXT_ID [i], x); 105 132 if (_param->_have_port_depth) 106 PORT_WRITE(out_DECOD_DEPTH [i], PORT_READ(in_CONTEXT_DEPTH [x]));133 PORT_WRITE(out_DECOD_DEPTH [i], depth); 107 134 PORT_WRITE(out_DECOD_TYPE [i], type); 108 135 PORT_WRITE(out_DECOD_OPERATION [i], _decod_instruction->_operation ); 136 PORT_WRITE(out_DECOD_NO_EXECUTE [i], _decod_instruction->_no_execute ); 109 137 PORT_WRITE(out_DECOD_IS_DELAY_SLOT [i], _decod_instruction->_is_delay_slot ); 110 138 PORT_WRITE(out_DECOD_ADDRESS [i], addr); … … 122 150 PORT_WRITE(out_DECOD_NUM_REG_RE [i], _decod_instruction->_num_reg_re ); 123 151 PORT_WRITE(out_DECOD_EXCEPTION_USE [i], _decod_instruction->_exception_use ); 152 // PORT_WRITE(out_DECOD_EXCEPTION [i], _decod_instruction->_exception ); 124 153 125 154 if (type == TYPE_BRANCH) 126 155 { 127 log_printf(TRACE,Decod,FUNCTION," * type is branch"); 156 log_printf(TRACE,Decod,FUNCTION," * type is branch"); 157 log_printf(TRACE,Decod,FUNCTION," * address src : %.8x (%.8x)",_decod_instruction->_address ,_decod_instruction->_address <<2); 158 log_printf(TRACE,Decod,FUNCTION," * address dest : %.8x (%.8x)",_decod_instruction->_address_next,_decod_instruction->_address_next<<2); 128 159 129 160 predict_val [i] = ifetch_ack [x][y] // and decod_val [i] … … 136 167 PORT_WRITE(out_PREDICT_MATCH_INST_IFETCH_PTR [i],y == ((_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_IFETCH_INST_IFETCH_PTR [x]):0)); 137 168 PORT_WRITE(out_PREDICT_BRANCH_STATE [i],PORT_READ(in_IFETCH_BRANCH_STATE [x])); 138 if (_param->_have_port_ branch_update_prediction_id)139 169 if (_param->_have_port_depth) 170 PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x])); 140 171 PORT_WRITE(out_PREDICT_BRANCH_CONDITION [i],_decod_instruction->_branch_condition ); 141 172 // PORT_WRITE(out_PREDICT_BRANCH_STACK_WRITE [i],_decod_instruction->_branch_stack_write); … … 145 176 146 177 //can_continue_next [x] = PORT_READ(in_PREDICT_CAN_CONTINUE [i]); // can continue is set if direction is "not take" (also, continue is sequential order) 147 can_continue_next [x] = false; // one branch per context 178 can_continue_next [x] = false; // one branch per context, the DS don't execute 148 179 } 149 180 … … 160 191 if (_param->_have_port_context_id) 161 192 PORT_WRITE(out_CONTEXT_EVENT_CONTEXT_ID , x); 193 if (_param->_have_port_depth) 194 PORT_WRITE(out_CONTEXT_EVENT_DEPTH , depth); 162 195 PORT_WRITE(out_CONTEXT_EVENT_TYPE , _decod_instruction->_event_type ); 163 196 PORT_WRITE(out_CONTEXT_EVENT_IS_DELAY_SLOT, _decod_instruction->_is_delay_slot ); … … 184 217 } 185 218 186 log_printf(TRACE,Decod,FUNCTION," - num_(decod, context, fetch) : %d %d %d",i, x, y);187 log_printf(TRACE,Decod,FUNCTION," - ifetch_ack : %d",ifetch_ack [x][y]);188 log_printf(TRACE,Decod,FUNCTION," - context_event_val : %d",context_event_val );189 log_printf(TRACE,Decod,FUNCTION," - predict_val : %d",predict_val [i] );190 log_printf(TRACE,Decod,FUNCTION," - decod_val : %d",decod_val [i] );219 log_printf(TRACE,Decod,FUNCTION," - num_(decod, context, fetch) : %d %d %d",i, x, y); 220 log_printf(TRACE,Decod,FUNCTION," - ifetch_ack : %d",ifetch_ack [x][y]); 221 log_printf(TRACE,Decod,FUNCTION," - context_event_val : %d",context_event_val ); 222 log_printf(TRACE,Decod,FUNCTION," - predict_val : %d",predict_val [i] ); 223 log_printf(TRACE,Decod,FUNCTION," - decod_val : %d",decod_val [i] ); 191 224 192 225 it ++; … … 207 240 PORT_WRITE(out_PREDICT_VAL [i], predict_val [i]); 208 241 PORT_WRITE(out_DECOD_VAL [i], decod_val [i]); 209 } 210 211 log_printf(FUNC,Decod,FUNCTION,"End"); 242 243 #ifdef STATISTICS 244 internal_DECOD_VAL [i] = decod_val [i]; 245 #endif 246 } 247 248 log_end(Decod,FUNCTION); 212 249 }; 213 250
Note: See TracChangeset
for help on using the changeset viewer.