Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod.cpp
r81 r88 38 38 log_printf(FUNC,Decod,FUNCTION,"Begin"); 39 39 40 #if DEBUG_Decod == true 41 log_printf(INFO,Decod,FUNCTION,_("<%s> Parameters"),_name.c_str()); 42 43 std::cout << *param << std::endl; 44 #endif 45 40 46 log_printf(INFO,Decod,FUNCTION,"Allocation"); 41 47 … … 47 53 48 54 #ifdef STATISTICS 49 if ( _usage & USE_STATISTICS)55 if (usage_is_set(_usage,USE_STATISTICS)) 50 56 { 51 57 log_printf(INFO,Decod,FUNCTION,"Allocation of statistics"); … … 56 62 57 63 #ifdef VHDL 58 if ( _usage & USE_VHDL)64 if (usage_is_set(_usage,USE_VHDL)) 59 65 { 60 66 // generate the vhdl … … 66 72 67 73 #ifdef SYSTEMC 68 if ( _usage & USE_SYSTEMC)74 if (usage_is_set(_usage,USE_SYSTEMC)) 69 75 { 70 76 log_printf(INFO,Decod,FUNCTION,"Method - transition"); … … 95 101 if (_param->_have_port_context_id) 96 102 sensitive << (*(in_IFETCH_CONTEXT_ID [i])); 97 if (_param->_have_port_ branch_update_prediction_id)103 if (_param->_have_port_depth) 98 104 sensitive << (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i])); 99 105 if (_param->_have_port_depth) … … 110 116 111 117 # ifdef SYSTEMCASS_SPECIFIC 118 /* 112 119 // List dependency information 113 120 … … 162 169 } 163 170 164 if (_param->_have_port_depth) 165 { 166 for (uint32_t x=0; x<_param->_nb_context; x++) 167 { 171 for (uint32_t x=0; x<_param->_nb_context; x++) 172 { 173 if (_param->_have_port_depth[i]) 174 { 175 168 176 (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); 169 177 (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DEPTH [x])); … … 402 410 if (_param->_have_port_context_id) 403 411 (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_CONTEXT_ID [x])); 404 if (_param->_have_port_inst_ifetch_ptr )412 if (_param->_have_port_inst_ifetch_ptr[i]) 405 413 (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_INST_IFETCH_PTR [x])); 406 414 for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) … … 601 609 } 602 610 } 603 611 */ 604 612 # endif 605 613 … … 617 625 618 626 #ifdef STATISTICS 619 if ( _usage & USE_STATISTICS)627 if (usage_is_set(_usage,USE_STATISTICS)) 620 628 { 621 629 statistics_deallocation(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp
r86 r88 1 1 /* 2 * $ Id$2 * $id: Decod_allocation.cpp 86 2008-05-14 17:08:56Z rosiere $ 3 3 * 4 4 * [ Description ] … … 58 58 // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 59 { 60 ALLOC2_INTERFACE("ifetch", IN, WEST, "Instruction's bundle", _param->_nb_context, _param->_nb_inst_fetch[ alloc_interface_it1]);60 ALLOC2_INTERFACE("ifetch", IN, WEST, "Instruction's bundle", _param->_nb_context, _param->_nb_inst_fetch[it1]); 61 61 62 62 63 _ALLOC2_VALACK_IN ( in_IFETCH_VAL ,VAL, _param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);64 _ALLOC2_VALACK_OUT(out_IFETCH_ACK ,ACK, _param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);65 _ALLOC2_SIGNAL_IN ( in_IFETCH_INSTRUCTION,"instruction", Tinstruction_t, _param->_size_instruction,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);63 _ALLOC2_VALACK_IN ( in_IFETCH_VAL ,VAL, _param->_nb_context, _param->_nb_inst_fetch[it1]); 64 _ALLOC2_VALACK_OUT(out_IFETCH_ACK ,ACK, _param->_nb_context, _param->_nb_inst_fetch[it1]); 65 _ALLOC2_SIGNAL_IN ( in_IFETCH_INSTRUCTION,"instruction", Tinstruction_t, _param->_size_instruction,_param->_nb_context, _param->_nb_inst_fetch[it1]); 66 66 } 67 67 { 68 68 ALLOC1_INTERFACE("ifetch", IN, WEST, "Instruction's bundle", _param->_nb_context); 69 69 70 ALLOC1_SIGNAL_IN (in_IFETCH_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 71 ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS ,"address" ,Tgeneral_address_t ,_param->_size_address_inst ); 72 // ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t ,_param->_size_address_inst ); 73 ALLOC1_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr ); 74 ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 75 ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_branch_update_prediction); 70 ALLOC1_SIGNAL_IN (in_IFETCH_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 71 ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS ,"address" ,Tgeneral_address_t ,_param->_size_instruction_address ); 72 // ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t ,_param->_size_instruction_address ); 73 ALLOC1_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr ); 74 ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 75 ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth ); 76 ALLOC1_SIGNAL_IN (in_IFETCH_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch); 76 77 } 77 78 … … 86 87 ALLOC1_SIGNAL_OUT(out_DECOD_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 87 88 ALLOC1_SIGNAL_OUT(out_DECOD_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); 89 ALLOC1_SIGNAL_OUT(out_DECOD_NO_EXECUTE ,"no_execute" ,Tcontrol_t ,1 ); 88 90 ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t ,1 ); 89 ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_data_t ,_param->_size_ address_inst);91 ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_data_t ,_param->_size_instruction_address ); 90 92 ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); 91 93 ALLOC1_SIGNAL_OUT(out_DECOD_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); … … 101 103 ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RE ,"num_reg_re" ,Tspecial_address_t,_param->_size_special_register_logic); 102 104 ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION_USE,"exception_use",Texception_t ,_param->_size_exception_use ); 105 ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_decod ); 103 106 } 104 107 … … 109 112 ALLOC1_VALACK_OUT(out_PREDICT_VAL ,VAL); 110 113 ALLOC1_VALACK_IN ( in_PREDICT_ACK ,ACK); 111 ALLOC1_SIGNAL_OUT(out_PREDICT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id 112 ALLOC1_SIGNAL_OUT(out_PREDICT_MATCH_INST_IFETCH_PTR ,"match_inst_ifetch_ptr" ,Tcontrol_t ,1 113 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state 114 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);115 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_CONDITION ,"branch_condition" ,Tbranch_condition_t,_param->_size_branch_condition 116 // ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE ,"branch_stack_write" ,Tcontrol_t ,1 117 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_DIRECTION ,"branch_direction" ,Tcontrol_t ,1 118 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC ,"address_src" ,Tgeneral_data_t ,_param->_size_ address_inst);119 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST ,"address_dest" ,Tgeneral_data_t ,_param->_size_ address_inst);120 // ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE ,"can_continue" ,Tcontrol_t ,1 114 ALLOC1_SIGNAL_OUT(out_PREDICT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 115 ALLOC1_SIGNAL_OUT(out_PREDICT_MATCH_INST_IFETCH_PTR ,"match_inst_ifetch_ptr" ,Tcontrol_t ,1 ); 116 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 117 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth ); 118 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_CONDITION ,"branch_condition" ,Tbranch_condition_t,_param->_size_branch_condition); 119 // ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE ,"branch_stack_write" ,Tcontrol_t ,1 ); 120 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_DIRECTION ,"branch_direction" ,Tcontrol_t ,1 ); 121 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC ,"address_src" ,Tgeneral_data_t ,_param->_size_instruction_address ); 122 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST ,"address_dest" ,Tgeneral_data_t ,_param->_size_instruction_address ); 123 // ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE ,"can_continue" ,Tcontrol_t ,1 ); 121 124 } 122 125 … … 136 139 ALLOC_VALACK_IN ( in_CONTEXT_EVENT_ACK ,ACK); 137 140 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 141 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth ); 138 142 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type ); 139 143 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t ,1 ); 140 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS ,"address" ,Tgeneral_data_t,_param->_size_address_inst); 141 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_address_inst); 142 } 143 144 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 144 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS ,"address" ,Tgeneral_data_t,_param->_size_instruction_address); 145 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_instruction_address); 146 } 147 148 149 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 150 if (usage_is_set(_usage,USE_SYSTEMC)) 151 { 146 152 reg_CONTEXT_ADDRESS_PREVIOUS = new Tgeneral_data_t [_param->_nb_context]; 147 153 reg_CONTEXT_IS_DELAY_SLOT = new Tcontrol_t [_param->_nb_context]; … … 150 156 internal_CONTEXT_ADDRESS_PREVIOUS = new Tgeneral_data_t [_param->_nb_context]; 151 157 internal_CONTEXT_IS_DELAY_SLOT = new Tcontrol_t [_param->_nb_context]; 158 159 #ifdef STATISTICS 160 internal_DECOD_VAL = new Tcontrol_t [_param->_nb_inst_decod]; 161 #endif 162 } 163 164 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 165 _priority = new generic::priority::Priority (_name+"_priority" , 166 _param->_priority , 167 _param->_load_balancing, 168 _param->_nb_context , 169 _param->_nb_inst_fetch , 170 _param->_nb_context_select); 152 171 153 172 const uint32_t nb_opcod_type = 14; … … 415 434 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4 ]) _function_decod [i][ 2][OPCOD_LV_CUST4 ] = &(instruction_lv_custom); 416 435 417 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1 ]) _function_custom[i][ 0][OPCOD_L_CUST1 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_1 );418 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2 ]) _function_custom[i][ 0][OPCOD_L_CUST2 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_2 );419 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3 ]) _function_custom[i][ 0][OPCOD_L_CUST3 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_3 );420 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4 ]) _function_custom[i][ 0][OPCOD_L_CUST4 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_4 );421 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5 ]) _function_custom[i][ 0][OPCOD_L_CUST5 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_5 );422 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6 ]) _function_custom[i][ 0][OPCOD_L_CUST6 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_6 );423 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7 ]) _function_custom[i][ 0][OPCOD_L_CUST7 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_7 );424 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8 ]) _function_custom[i][ 0][OPCOD_L_CUST8 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_L_8 );425 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_LF_1_D);426 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_LF_1_S);427 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1 ]) _function_custom[i][ 2][OPCOD_LV_CUST1 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_LV_1 );428 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2 ]) _function_custom[i][ 2][OPCOD_LV_CUST2 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_LV_2 );429 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3 ]) _function_custom[i][ 2][OPCOD_LV_CUST3 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_LV_3 );430 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4 ]) _function_custom[i][ 2][OPCOD_LV_CUST4 ] = _param->_get_custom_information( i)._get_custom_decod(OPERATION_CUSTOM_LV_4 );436 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1 ]) _function_custom[i][ 0][OPCOD_L_CUST1 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_1 ); 437 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2 ]) _function_custom[i][ 0][OPCOD_L_CUST2 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_2 ); 438 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3 ]) _function_custom[i][ 0][OPCOD_L_CUST3 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_3 ); 439 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4 ]) _function_custom[i][ 0][OPCOD_L_CUST4 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_4 ); 440 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5 ]) _function_custom[i][ 0][OPCOD_L_CUST5 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_5 ); 441 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6 ]) _function_custom[i][ 0][OPCOD_L_CUST6 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_6 ); 442 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7 ]) _function_custom[i][ 0][OPCOD_L_CUST7 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_7 ); 443 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8 ]) _function_custom[i][ 0][OPCOD_L_CUST8 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_8 ); 444 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_D); 445 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_S); 446 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1 ]) _function_custom[i][ 2][OPCOD_LV_CUST1 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_1 ); 447 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2 ]) _function_custom[i][ 2][OPCOD_LV_CUST2 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_2 ); 448 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3 ]) _function_custom[i][ 2][OPCOD_LV_CUST3 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_3 ); 449 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4 ]) _function_custom[i][ 2][OPCOD_LV_CUST4 ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_4 ); 431 450 } 432 451 … … 440 459 441 460 #ifdef POSITION 442 _component->generate_file(); 461 if (usage_is_set(_usage,USE_POSITION)) 462 _component->generate_file(); 443 463 #endif 444 464 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp
r86 r88 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h" 9 #include "Behavioural/include/Allocation.h" 9 10 10 11 namespace morpheo { … … 27 28 delete in_CLOCK ; 28 29 delete in_NRESET; 30 31 DELETE2_SIGNAL( in_IFETCH_VAL , _param->_nb_context, _param->_nb_inst_fetch[it1],1); 32 DELETE2_SIGNAL(out_IFETCH_ACK , _param->_nb_context, _param->_nb_inst_fetch[it1],1); 33 DELETE2_SIGNAL( in_IFETCH_INSTRUCTION, _param->_nb_context, _param->_nb_inst_fetch[it1],_param->_size_instruction); 34 35 DELETE1_SIGNAL(in_IFETCH_CONTEXT_ID , _param->_nb_context,_param->_size_context_id ); 36 DELETE1_SIGNAL(in_IFETCH_ADDRESS , _param->_nb_context,_param->_size_instruction_address ); 37 // DELETE1_SIGNAL(in_IFETCH_ADDRESS_NEXT , _param->_nb_context,_param->_size_instruction_address ); 38 DELETE1_SIGNAL(in_IFETCH_INST_IFETCH_PTR , _param->_nb_context,_param->_size_inst_ifetch_ptr ); 39 DELETE1_SIGNAL(in_IFETCH_BRANCH_STATE , _param->_nb_context,_param->_size_branch_state ); 40 DELETE1_SIGNAL(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID, _param->_nb_context,_param->_size_depth ); 41 DELETE1_SIGNAL(in_IFETCH_EXCEPTION , _param->_nb_context,_param->_size_exception_ifetch); 29 42 30 delete [] in_IFETCH_VAL ; 31 delete [] out_IFETCH_ACK ; 32 delete [] in_IFETCH_INSTRUCTION ; 33 if (_param->_have_port_context_id) 34 delete [] in_IFETCH_CONTEXT_ID ; 35 delete [] in_IFETCH_ADDRESS ; 36 // delete [] in_IFETCH_ADDRESS_NEXT ; 37 if (_param->_have_port_inst_ifetch_ptr) 38 delete [] in_IFETCH_INST_IFETCH_PTR ; 39 delete [] in_IFETCH_BRANCH_STATE ; 40 if (_param->_have_port_branch_update_prediction_id) 41 delete [] in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ; 43 DELETE1_SIGNAL(out_DECOD_VAL ,_param->_nb_inst_decod,1); 44 DELETE1_SIGNAL( in_DECOD_ACK ,_param->_nb_inst_decod,1); 45 DELETE1_SIGNAL(out_DECOD_CONTEXT_ID ,_param->_nb_inst_decod,_param->_size_context_id ); 46 DELETE1_SIGNAL(out_DECOD_DEPTH ,_param->_nb_inst_decod,_param->_size_depth ); 47 DELETE1_SIGNAL(out_DECOD_TYPE ,_param->_nb_inst_decod,_param->_size_type ); 48 DELETE1_SIGNAL(out_DECOD_OPERATION ,_param->_nb_inst_decod,_param->_size_operation ); 49 DELETE1_SIGNAL(out_DECOD_NO_EXECUTE ,_param->_nb_inst_decod,1 ); 50 DELETE1_SIGNAL(out_DECOD_IS_DELAY_SLOT,_param->_nb_inst_decod,1 ); 51 DELETE1_SIGNAL(out_DECOD_ADDRESS ,_param->_nb_inst_decod,_param->_size_instruction_address ); 52 DELETE1_SIGNAL(out_DECOD_HAS_IMMEDIAT ,_param->_nb_inst_decod,1 ); 53 DELETE1_SIGNAL(out_DECOD_IMMEDIAT ,_param->_nb_inst_decod,_param->_size_general_data ); 54 DELETE1_SIGNAL(out_DECOD_READ_RA ,_param->_nb_inst_decod,1 ); 55 DELETE1_SIGNAL(out_DECOD_NUM_REG_RA ,_param->_nb_inst_decod,_param->_size_general_register_logic); 56 DELETE1_SIGNAL(out_DECOD_READ_RB ,_param->_nb_inst_decod,1 ); 57 DELETE1_SIGNAL(out_DECOD_NUM_REG_RB ,_param->_nb_inst_decod,_param->_size_general_register_logic); 58 DELETE1_SIGNAL(out_DECOD_READ_RC ,_param->_nb_inst_decod,1 ); 59 DELETE1_SIGNAL(out_DECOD_NUM_REG_RC ,_param->_nb_inst_decod,_param->_size_special_register_logic); 60 DELETE1_SIGNAL(out_DECOD_WRITE_RD ,_param->_nb_inst_decod,1 ); 61 DELETE1_SIGNAL(out_DECOD_NUM_REG_RD ,_param->_nb_inst_decod,_param->_size_general_register_logic); 62 DELETE1_SIGNAL(out_DECOD_WRITE_RE ,_param->_nb_inst_decod,1 ); 63 DELETE1_SIGNAL(out_DECOD_NUM_REG_RE ,_param->_nb_inst_decod,_param->_size_special_register_logic); 64 DELETE1_SIGNAL(out_DECOD_EXCEPTION_USE,_param->_nb_inst_decod,_param->_size_exception_use ); 65 DELETE1_SIGNAL(out_DECOD_EXCEPTION ,_param->_nb_inst_decod,_param->_size_exception_decod ); 42 66 43 delete [] out_DECOD_VAL ; 44 delete [] in_DECOD_ACK ; 45 if (_param->_have_port_context_id) 46 delete [] out_DECOD_CONTEXT_ID ; 47 if (_param->_have_port_depth) 48 delete [] out_DECOD_DEPTH ; 49 delete [] out_DECOD_TYPE ; 50 delete [] out_DECOD_OPERATION ; 51 delete [] out_DECOD_IS_DELAY_SLOT ; 52 delete [] out_DECOD_ADDRESS ; 53 delete [] out_DECOD_HAS_IMMEDIAT ; 54 delete [] out_DECOD_IMMEDIAT ; 55 delete [] out_DECOD_READ_RA ; 56 delete [] out_DECOD_NUM_REG_RA ; 57 delete [] out_DECOD_READ_RB ; 58 delete [] out_DECOD_NUM_REG_RB ; 59 delete [] out_DECOD_READ_RC ; 60 delete [] out_DECOD_NUM_REG_RC ; 61 delete [] out_DECOD_WRITE_RD ; 62 delete [] out_DECOD_NUM_REG_RD ; 63 delete [] out_DECOD_WRITE_RE ; 64 delete [] out_DECOD_NUM_REG_RE ; 65 delete [] out_DECOD_EXCEPTION_USE ; 67 DELETE1_SIGNAL(out_PREDICT_VAL ,_param->_nb_inst_decod,1); 68 DELETE1_SIGNAL( in_PREDICT_ACK ,_param->_nb_inst_decod,1); 69 DELETE1_SIGNAL(out_PREDICT_CONTEXT_ID ,_param->_nb_inst_decod,_param->_size_context_id ); 70 DELETE1_SIGNAL(out_PREDICT_MATCH_INST_IFETCH_PTR ,_param->_nb_inst_decod,1 ); 71 DELETE1_SIGNAL(out_PREDICT_BRANCH_STATE ,_param->_nb_inst_decod,_param->_size_branch_state ); 72 DELETE1_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_inst_decod,_param->_size_depth ); 73 DELETE1_SIGNAL(out_PREDICT_BRANCH_CONDITION ,_param->_nb_inst_decod,_param->_size_branch_condition); 74 // DELETE1_SIGNAL(out_PREDICT_BRANCH_STACK_WRITE ,_param->_nb_inst_decod,1 ); 75 DELETE1_SIGNAL(out_PREDICT_BRANCH_DIRECTION ,_param->_nb_inst_decod,1 ); 76 DELETE1_SIGNAL(out_PREDICT_ADDRESS_SRC ,_param->_nb_inst_decod,_param->_size_instruction_address ); 77 DELETE1_SIGNAL(out_PREDICT_ADDRESS_DEST ,_param->_nb_inst_decod,_param->_size_instruction_address ); 78 // DELETE1_SIGNAL( in_PREDICT_CAN_CONTINUE ,_param->_nb_inst_decod,1 ); 66 79 67 delete [] out_PREDICT_VAL ; 68 delete [] in_PREDICT_ACK ; 69 if (_param->_have_port_context_id) 70 delete [] out_PREDICT_CONTEXT_ID ; 71 delete [] out_PREDICT_BRANCH_STATE ; 72 delete [] out_PREDICT_MATCH_INST_IFETCH_PTR ; 73 if (_param->_have_port_branch_update_prediction_id) 74 delete [] out_PREDICT_BRANCH_UPDATE_PREDICTION_ID; 75 delete [] out_PREDICT_BRANCH_CONDITION ; 76 // delete [] out_PREDICT_BRANCH_STACK_WRITE ; 77 delete [] out_PREDICT_BRANCH_DIRECTION ; 78 delete [] out_PREDICT_ADDRESS_SRC ; 79 delete [] out_PREDICT_ADDRESS_DEST ; 80 // delete [] in_PREDICT_CAN_CONTINUE ; 80 DELETE1_SIGNAL(in_CONTEXT_DECOD_ENABLE, _param->_nb_context,1); 81 DELETE1_SIGNAL(in_CONTEXT_DEPTH , _param->_nb_context,_param->_size_depth); 81 82 82 delete [] in_CONTEXT_DECOD_ENABLE ; 83 if (_param->_have_port_depth) 84 delete [] in_CONTEXT_DEPTH ; 83 DELETE_SIGNAL (out_CONTEXT_EVENT_VAL ,1); 84 DELETE_SIGNAL ( in_CONTEXT_EVENT_ACK ,1); 85 DELETE_SIGNAL (out_CONTEXT_EVENT_CONTEXT_ID ,_param->_size_context_id ); 86 DELETE_SIGNAL (out_CONTEXT_EVENT_DEPTH ,_param->_size_depth ); 87 DELETE_SIGNAL (out_CONTEXT_EVENT_TYPE ,_param->_size_event_type ); 88 DELETE_SIGNAL (out_CONTEXT_EVENT_IS_DELAY_SLOT,1 ); 89 DELETE_SIGNAL (out_CONTEXT_EVENT_ADDRESS ,_param->_size_instruction_address); 90 DELETE_SIGNAL (out_CONTEXT_EVENT_ADDRESS_EPCR ,_param->_size_instruction_address); 85 91 86 delete out_CONTEXT_EVENT_VAL ; 87 delete in_CONTEXT_EVENT_ACK ; 88 if (_param->_have_port_context_id) 89 delete out_CONTEXT_EVENT_CONTEXT_ID ; 90 delete out_CONTEXT_EVENT_TYPE ; 91 delete out_CONTEXT_EVENT_IS_DELAY_SLOT ; 92 delete out_CONTEXT_EVENT_ADDRESS ; 93 delete out_CONTEXT_EVENT_ADDRESS_EPCR ; 92 93 94 delete reg_CONTEXT_ADDRESS_PREVIOUS ; 95 delete [] reg_CONTEXT_IS_DELAY_SLOT ; 96 97 delete [] internal_CONTEXT_HAVE_TRANSACTION ; 98 delete [] internal_CONTEXT_ADDRESS_PREVIOUS ; 99 delete [] internal_CONTEXT_IS_DELAY_SLOT ; 100 101 #ifdef STATISTICS 102 delete [] internal_DECOD_VAL; 103 #endif 94 104 } 95 105 96 106 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 delete reg_CONTEXT_ADDRESS_PREVIOUS ; 98 delete reg_CONTEXT_IS_DELAY_SLOT ; 107 delete _priority; 99 108 100 delete internal_CONTEXT_HAVE_TRANSACTION ;101 delete internal_CONTEXT_ADDRESS_PREVIOUS ;102 delete internal_CONTEXT_IS_DELAY_SLOT ;103 109 104 110 const uint32_t nb_opcod_type = 14; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_end_cycle.cpp
r81 r88 25 25 26 26 #ifdef STATISTICS 27 _stat->end_cycle(); 27 if (usage_is_set(_usage,USE_STATISTICS)) 28 _stat->end_cycle(); 28 29 #endif 29 30 … … 31 32 // Evaluation before read the ouput signal 32 33 // sc_start(0); 33 _interfaces->testbench(); 34 if (usage_is_set(_usage,VHDL_TESTBENCH)) 35 _interfaces->testbench(); 34 36 #endif 35 37 -
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 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_statistics_allocation.cpp
r81 r88 27 27 "Decod", 28 28 param_statistics); 29 30 _stat_sum_inst_decod = _stat->create_variable ("sum_inst_decod" // ,"", "Sum of decod instruction"31 );32 29 30 _stat_sum_inst_decod = _stat->create_variable("sum_inst_decod"); 31 32 33 _stat->create_expr_average_by_cycle ("average_nb_inst_decod","sum_inst_decod","","Average of decod instruction by cycle"); 34 _stat->create_expr_percent ("percent_nb_inst_decod","average_nb_inst_decod", toString(_param->_nb_inst_decod), "Percent of decod instruction by cycle"); 35 33 36 34 _stat->create_expr_average_by_cycle ("average_sum_inst_decod","sum_inst_decod","","Average of decod instruction by cycle");35 _stat->create_expr_percent ("percent_sum_inst_decod","average_sum_inst_decod", toString(_param->_nb_inst_decod), "Percent of decod instruction by cycle");36 37 37 38 log_printf(FUNC,Decod,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_transition.cpp
r87 r88 22 22 void Decod::transition (void) 23 23 { 24 log_ printf(FUNC,Decod,FUNCTION,"Begin");24 log_begin(Decod,FUNCTION); 25 25 26 26 if (PORT_READ(in_NRESET) == 0) 27 27 { 28 reg_CONTEXT_PRIORITY = 0;28 _priority->reset(); 29 29 30 30 for (uint32_t i=0; i<_param->_nb_context; i++) … … 36 36 else 37 37 { 38 switch (_param->_priority) 39 { 40 // case PRIORITY_STATIC : 41 // { 42 // reg_CONTEXT_PRIORITY = (reg_CONTEXT_PRIORITY+_param->_nb_context_select)%_param->_nb_context; 43 // break; 44 // } 45 case PRIORITY_ROUND_ROBIN : 46 { 47 reg_CONTEXT_PRIORITY = (reg_CONTEXT_PRIORITY+1 )%_param->_nb_context; 48 break; 49 } 50 default: 51 { 52 break; 53 } 54 } 55 56 // flush list 57 select.clear(); 58 59 // Compute next scan order !!! 60 switch (_param->_load_balancing) 61 { 62 // case LOAD_BALANCING_BALANCE : 63 // { 64 // for (uint32_t j=0; j<_param->_max_nb_inst_fetch; j++) 65 // for (uint32_t i=0; i<_param->_nb_context_select; i++) 66 // { 67 // uint32_t x=(reg_CONTEXT_PRIORITY+i)%_param->_nb_context; 68 69 // // Test valid inst_fetch 70 // if (j < _param->_nb_inst_fetch[x]) 71 // select.push_back(select_t(x,j)); 72 // } 73 74 // break; 75 // } 76 case LOAD_BALANCING_MAXIMUM_FOR_PRIORITY : 77 { 78 79 for (uint32_t i=0; i<_param->_nb_context_select; i++) 80 { 81 uint32_t x=(reg_CONTEXT_PRIORITY+i)%_param->_nb_context; 82 83 for (uint32_t j=0; j<_param->_nb_inst_fetch[x]; j++) 84 select.push_back(select_t(x,j)); 85 } 86 87 break; 88 } 89 default : 90 { 91 break; 92 } 93 } 38 _priority->transition(); 94 39 95 40 // Compute "next previous" address … … 97 42 if (internal_CONTEXT_HAVE_TRANSACTION[i]) 98 43 { 99 #ifdef STATISTICS100 (*_stat_sum_inst_decod) ++;101 #endif102 103 44 reg_CONTEXT_ADDRESS_PREVIOUS [i] = internal_CONTEXT_ADDRESS_PREVIOUS [i]; 104 45 reg_CONTEXT_IS_DELAY_SLOT [i] = internal_CONTEXT_IS_DELAY_SLOT [i]; … … 107 48 // for (uint32_t i=0; i<_param->_nb_context; i++) 108 49 // log_printf(TRACE,Decod,FUNCTION,"[%d] %.8x %d",i,reg_CONTEXT_ADDRESS_PREVIOUS [i], reg_CONTEXT_IS_DELAY_SLOT [i]); 50 51 #ifdef STATISTICS 52 if (usage_is_set(_usage,USE_STATISTICS)) 53 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 54 if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i])) 55 (*_stat_sum_inst_decod) ++; 56 #endif 109 57 } 110 58 … … 113 61 #endif 114 62 115 log_ printf(FUNC,Decod,FUNCTION,"End");63 log_end(Decod,FUNCTION); 116 64 }; 117 65 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters.cpp
r87 r88 1 1 /* 2 3 2 * $Id$ 4 3 * … … 24 23 uint32_t * nb_inst_fetch , 25 24 uint32_t nb_inst_decod , 26 uint32_t 27 uint32_tsize_branch_update_prediction,25 uint32_t * nb_branch_speculated , 26 // uint32_t * size_branch_update_prediction, 28 27 uint32_t nb_context_select , 29 28 uint32_t size_general_data , … … 31 30 Tload_balancing_t load_balancing , 32 31 bool ** instruction_implemeted , 33 morpheo::behavioural::custom::custom_information_t (*get_custom_information) (uint32_t)) 32 morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void), 33 bool is_toplevel 34 ) 34 35 { 35 36 log_printf(FUNC,Decod,FUNCTION,"Begin"); … … 40 41 _nb_branch_speculated = nb_branch_speculated ; 41 42 _nb_context_select = nb_context_select ; 42 43 43 // _size_branch_update_prediction = size_branch_update_prediction; 44 // _size_general_data = size_general_data ; 44 45 _priority = priority ; 45 46 _load_balancing = load_balancing ; … … 52 53 53 54 54 _max_nb_inst_fetch = max<uint32_t>(nb_inst_fetch,nb_context); 55 _max_nb_inst_fetch = max<uint32_t>(nb_inst_fetch,nb_context); 56 57 // _size_address_inst = size_general_data-2; 55 58 56 _size_address_inst = size_general_data-2; 57 _size_context_id = log2(nb_context ); 58 _size_depth = log2(nb_branch_speculated); 59 _size_inst_ifetch_ptr = log2(_max_nb_inst_fetch ); 59 test(); 60 60 61 _have_port_context_id = _size_context_id > 0; 62 _have_port_depth = _size_depth > 0; 63 _have_port_branch_update_prediction_id = _size_branch_update_prediction > 0; 64 _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; 65 66 test(); 61 if (is_toplevel) 62 { 63 _size_context_id = log2(nb_context ); 64 _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_context)); 65 // _size_branch_update_prediction_id = max<uint32_t>(_size_branch_update_prediction,_nb_context); 66 _size_inst_ifetch_ptr = log2(_max_nb_inst_fetch ); 67 _size_instruction_address = size_general_data-2; 68 _size_general_data = size_general_data; 69 70 _have_port_context_id = _size_context_id > 0; 71 _have_port_depth = _size_depth > 0; 72 // _have_port_branch_update_prediction_id= _size_branch_update_prediction_id > 0; 73 _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; 74 75 copy (); 76 } 77 67 78 log_printf(FUNC,Decod,FUNCTION,"End"); 68 79 }; … … 82 93 { 83 94 log_printf(FUNC,Decod,FUNCTION,"Begin"); 95 96 log_printf(FUNC,Decod,FUNCTION,"End"); 97 }; 98 99 #undef FUNCTION 100 #define FUNCTION "Decod::copy" 101 void Parameters::copy (void) 102 { 103 log_printf(FUNC,Decod,FUNCTION,"Begin"); 104 84 105 log_printf(FUNC,Decod,FUNCTION,"End"); 85 106 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters_msg_error.cpp
r87 r88 31 31 test.error(_("nb_inst_decod must be > 0.\n")); 32 32 33 34 35 33 // if ((_size_general_data != 32) and 34 // (_size_general_data != 64)) 35 // test.error(_("size_general_data must be equal at 32 or 64 bits.\n")); 36 36 37 if ((_nb_branch_speculated == 0) or38 (_nb_branch_speculated > _nb_context))39 test.error(_("nb_branch_speculated must be in [1:nb_context].\n"));37 // if ((_nb_branch_speculated == 0) or 38 // (_nb_branch_speculated > _nb_context)) 39 // test.error(_("nb_branch_speculated must be in [1:nb_context].\n")); 40 40 41 41 if ((_nb_context_select == 0) or … … 48 48 49 49 if (sum_inst_fetch < _nb_inst_decod) 50 test.error(_("The sum of the _nb_context_select most nb_inst_fetch must be greater that _nb_inst_decod "));50 test.error(_("The sum of the _nb_context_select most nb_inst_fetch must be greater that _nb_inst_decod\n")); 51 51 52 52 if ((_priority != PRIORITY_ROUND_ROBIN)) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters_print.cpp
r81 r88 30 30 xml.singleton_begin("nb_inst_decod "); xml.attribut("value",toString(_nb_inst_decod )); xml.singleton_end(); 31 31 xml.singleton_begin("nb_branch_speculated "); xml.attribut("value",toString(_nb_branch_speculated )); xml.singleton_end(); 32 32 // xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end(); 33 33 xml.singleton_begin("nb_context_select "); xml.attribut("value",toString(_nb_context_select )); xml.singleton_end(); 34 34 xml.singleton_begin("size_general_data "); xml.attribut("value",toString(_size_general_data )); xml.singleton_end();
Note: See TracChangeset
for help on using the changeset viewer.