Changeset 136 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue
- Timestamp:
- Oct 20, 2009, 8:52:15 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Ifetch_queue.h
r131 r136 84 84 public : SC_IN (Tcontrol_t ) ** in_DECOD_ACK ;//[nb_instruction] 85 85 public : SC_OUT(Tinstruction_t ) ** out_DECOD_INSTRUCTION ;//[nb_instruction] 86 public : SC_OUT(Tgeneral_address_t ) * out_DECOD_ADDRESS ; 87 public : SC_OUT(Tinst_ifetch_ptr_t ) * out_DECOD_INST_IFETCH_PTR ; 88 public : SC_OUT(Tbranch_state_t ) * out_DECOD_BRANCH_STATE ; 89 public : SC_OUT(Tprediction_ptr_t ) * out_DECOD_BRANCH_UPDATE_PREDICTION_ID ; 90 public : SC_OUT(Texception_t ) * out_DECOD_EXCEPTION ; 86 public : SC_OUT(Tgeneral_address_t ) ** out_DECOD_ADDRESS ; 87 public : SC_OUT(Tbranch_state_t ) ** out_DECOD_BRANCH_STATE ; 88 public : SC_OUT(Tprediction_ptr_t ) ** out_DECOD_BRANCH_UPDATE_PREDICTION_ID ; 89 public : SC_OUT(Texception_t ) ** out_DECOD_EXCEPTION ; 90 //public : SC_OUT(Tgeneral_address_t ) * out_DECOD_ADDRESS ; 91 //public : SC_OUT(Tinst_ifetch_ptr_t ) * out_DECOD_INST_IFETCH_PTR ; 92 //public : SC_OUT(Tbranch_state_t ) * out_DECOD_BRANCH_STATE ; 93 //public : SC_OUT(Tprediction_ptr_t ) * out_DECOD_BRANCH_UPDATE_PREDICTION_ID ; 94 //public : SC_OUT(Texception_t ) * out_DECOD_EXCEPTION ; 91 95 92 96 // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 110 114 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 115 private : Tcontrol_t internal_ADDRESS_ACK ; 112 private : Tcontrol_t * internal_DECOD_VAL ; 116 private : Tcontrol_t * internal_DECOD_VAL ;//[nb_instruction] 117 private : uint32_t * internal_DECOD_PTR ;//[nb_instruction] Only queue_scheme == full_assoc 118 private : uint32_t * internal_DECOD_SLOT ;//[nb_instruction] Only queue_scheme == full_assoc 113 119 private : Tcontrol_t internal_ICACHE_RSP_ACK ; 114 120 private : Tcontrol_t internal_EVENT_RESET_ACK; 121 122 123 124 // function pointer 125 public : void (morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::*function_transition ) (void); 126 public : void (morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::*function_genMoore ) (void); 115 127 #endif 116 128 … … 146 158 #ifdef SYSTEMC 147 159 public : void constant (void); 148 public : void transition (void); 149 public : void genMoore (void); 160 161 public : void transition (void); 162 public : void genMoore (void); 163 164 public : void function_no_assoc_transition (void); 165 public : void function_no_assoc_genMoore (void); 166 167 public : void function_full_assoc_transition (void); 168 public : void function_full_assoc_genMoore (void); 150 169 #endif 151 170 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Parameters.h
r109 r136 11 11 #include "Common/include/Debug.h" 12 12 #include "Behavioural/include/Parameters.h" 13 #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Types.h" 13 14 14 15 namespace morpheo { … … 24 25 { 25 26 //-----[ fields ]------------------------------------------------------------ 26 public : uint32_t _size_queue ; 27 public : uint32_t _nb_instruction ; 28 //public : uint32_t _size_branch_update_prediction ; 29 //public : uint32_t _size_general_data ; 30 public : uint32_t _nb_instruction_in_queue ; 31 32 //public : uint32_t _size_queue_ptr ; 33 //public : uint32_t _size_instruction_ptr ; 34 35 //public : bool _have_port_queue_ptr ; 36 //public : bool _have_port_instruction_ptr ; 37 //public : bool _have_port_branch_update_prediction_id; 27 public : uint32_t _size_queue ; 28 public : Tifetch_queue_scheme_t _queue_scheme ; 29 public : uint32_t _nb_instruction ; 30 //public : uint32_t _size_branch_update_prediction ; 31 //public : uint32_t _size_general_data ; 32 public : uint32_t _nb_instruction_in_queue ; 33 34 //public : uint32_t _size_queue_ptr ; 35 //public : uint32_t _size_instruction_ptr ; 36 37 //public : bool _have_port_queue_ptr ; 38 //public : bool _have_port_instruction_ptr ; 39 //public : bool _have_port_branch_update_prediction_id; 38 40 39 41 //-----[ methods ]----------------------------------------------------------- 40 public : Parameters (uint32_t size_queue , 41 uint32_t nb_instruction , 42 uint32_t size_branch_update_prediction, 43 uint32_t size_general_data , 44 bool is_toplevel=false); 42 public : Parameters (uint32_t size_queue , 43 Tifetch_queue_scheme_t queue_scheme , 44 uint32_t nb_instruction , 45 uint32_t size_branch_update_prediction, 46 uint32_t size_general_data , 47 bool is_toplevel=false); 45 48 // public : Parameters (Parameters & param) ; 46 49 public : ~Parameters () ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Types.h
r135 r136 18 18 namespace ifetch_unit { 19 19 namespace ifetch_queue { 20 21 typedef enum 22 { 23 IFETCH_QUEUE_SCHEME_NO_ASSOC // Read only head 24 ,IFETCH_QUEUE_SCHEME_FULL_ASSOC // Scan all slot 25 } Tifetch_queue_scheme_t; 20 26 21 27 typedef enum … … 60 66 }; // end namespace core 61 67 }; // end namespace behavioural 68 69 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Tifetch_queue_scheme_t>(const morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Tifetch_queue_scheme_t& x) 70 { 71 switch (x) 72 { 73 case morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::IFETCH_QUEUE_SCHEME_NO_ASSOC : return "no_assoc" ; break; 74 case morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::IFETCH_QUEUE_SCHEME_FULL_ASSOC : return "full_assoc"; break; 75 default : return ""; break; 76 } 77 }; 78 79 template<> inline morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Tifetch_queue_scheme_t fromString<morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Tifetch_queue_scheme_t>(const std::string& x) 80 { 81 if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::IFETCH_QUEUE_SCHEME_NO_ASSOC ))) == 0) or 82 (x.compare("no_assoc") == 0)) 83 return morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::IFETCH_QUEUE_SCHEME_NO_ASSOC; 84 if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::IFETCH_QUEUE_SCHEME_FULL_ASSOC))) == 0) or 85 (x.compare("full_assoc") == 0)) 86 return morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::IFETCH_QUEUE_SCHEME_FULL_ASSOC; 87 88 throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\"")); 89 }; 62 90 63 91 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::ifetch_queue_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::ifetch_queue_state_t& x) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue.cpp
r132 r136 74 74 if (usage_is_set(_usage,USE_SYSTEMC)) 75 75 { 76 // Function pointer 77 switch (_param->_queue_scheme) 78 { 79 case IFETCH_QUEUE_SCHEME_NO_ASSOC : 80 { 81 function_transition = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_no_assoc_transition ; 82 function_genMoore = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_no_assoc_genMoore ; 83 84 break; 85 } 86 case IFETCH_QUEUE_SCHEME_FULL_ASSOC : 87 { 88 function_transition = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_full_assoc_transition ; 89 function_genMoore = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_full_assoc_genMoore ; 90 91 break; 92 } 93 default : 94 { 95 break; 96 } 97 } 98 76 99 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - constant"),_name.c_str()); 77 100 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_allocation.cpp
r112 r136 84 84 ALLOC1_VALACK_OUT(out_DECOD_VAL ,VAL); 85 85 ALLOC1_VALACK_IN ( in_DECOD_ACK ,ACK); 86 ALLOC1_SIGNAL_OUT(out_DECOD_INSTRUCTION,"instruction",Tinstruction_t,_param->_size_instruction); 86 ALLOC1_SIGNAL_OUT(out_DECOD_INSTRUCTION ,"instruction" ,Tinstruction_t ,_param->_size_instruction); 87 ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address); 88 ALLOC1_SIGNAL_OUT(out_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); 89 ALLOC1_SIGNAL_OUT(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); 90 ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch); 87 91 88 92 ALLOC1_INTERFACE_END(_param->_nb_instruction); 89 93 } 90 {91 ALLOC0_INTERFACE_BEGIN("decod",OUT, EAST, _("Send instruction bundle to the decod's stage."));94 // { 95 // ALLOC0_INTERFACE_BEGIN("decod",OUT, EAST, _("Send instruction bundle to the decod's stage.")); 92 96 93 ALLOC0_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address );94 ALLOC0_SIGNAL_OUT(out_DECOD_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr );95 ALLOC0_SIGNAL_OUT(out_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state );96 ALLOC0_SIGNAL_OUT(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth );97 ALLOC0_SIGNAL_OUT(out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch);97 // ALLOC0_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address ); 98 // ALLOC0_SIGNAL_OUT(out_DECOD_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr ); 99 // ALLOC0_SIGNAL_OUT(out_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 100 // ALLOC0_SIGNAL_OUT(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth ); 101 // ALLOC0_SIGNAL_OUT(out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch); 98 102 99 ALLOC0_INTERFACE_END();100 }103 // ALLOC0_INTERFACE_END(); 104 // } 101 105 102 106 // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 132 136 if (usage_is_set(_usage,USE_SYSTEMC)) 133 137 { 134 ALLOC1(internal_DECOD_VAL,Tcontrol_t,_param->_nb_instruction); 135 138 ALLOC1(internal_DECOD_VAL ,Tcontrol_t,_param->_nb_instruction); 139 if (_param->_queue_scheme == IFETCH_QUEUE_SCHEME_FULL_ASSOC) 140 { 141 ALLOC1(internal_DECOD_PTR ,uint32_t ,_param->_nb_instruction); 142 ALLOC1(internal_DECOD_SLOT,uint32_t ,_param->_nb_instruction); 143 } 144 136 145 _queue = new ifetch_queue_entry_t * [_param->_size_queue]; 137 146 for (uint32_t i=0;i<_param->_size_queue; i++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_deallocation.cpp
r123 r136 41 41 DELETE1_SIGNAL( in_DECOD_ACK ,_param->_nb_instruction,1); 42 42 DELETE1_SIGNAL(out_DECOD_INSTRUCTION ,_param->_nb_instruction,_param->_size_instruction); 43 DELETE0_SIGNAL(out_DECOD_ADDRESS ,_param->_size_instruction_address); 44 DELETE0_SIGNAL(out_DECOD_INST_IFETCH_PTR ,_param->_size_inst_ifetch_ptr ); 45 DELETE0_SIGNAL(out_DECOD_BRANCH_STATE ,_param->_size_branch_state ); 46 DELETE0_SIGNAL(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_size_depth ); 47 DELETE0_SIGNAL(out_DECOD_EXCEPTION ,_param->_size_exception_ifetch); 43 DELETE1_SIGNAL(out_DECOD_ADDRESS ,_param->_nb_instruction,_param->_size_instruction_address); 44 DELETE1_SIGNAL(out_DECOD_BRANCH_STATE ,_param->_nb_instruction,_param->_size_branch_state); 45 DELETE1_SIGNAL(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_instruction,_param->_size_depth); 46 DELETE1_SIGNAL(out_DECOD_EXCEPTION ,_param->_nb_instruction,_param->_size_exception_ifetch); 47 // DELETE0_SIGNAL(out_DECOD_ADDRESS ,_param->_size_instruction_address); 48 // DELETE0_SIGNAL(out_DECOD_INST_IFETCH_PTR ,_param->_size_inst_ifetch_ptr ); 49 // DELETE0_SIGNAL(out_DECOD_BRANCH_STATE ,_param->_size_branch_state ); 50 // DELETE0_SIGNAL(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_size_depth ); 51 // DELETE0_SIGNAL(out_DECOD_EXCEPTION ,_param->_size_exception_ifetch); 48 52 49 53 DELETE0_SIGNAL( in_ICACHE_RSP_VAL ,1); … … 60 64 if (usage_is_set(_usage,USE_SYSTEMC)) 61 65 { 62 DELETE1(internal_DECOD_VAL,_param->_nb_instruction); 66 DELETE1(internal_DECOD_VAL ,_param->_nb_instruction); 67 if (_param->_queue_scheme == IFETCH_QUEUE_SCHEME_FULL_ASSOC) 68 { 69 DELETE1(internal_DECOD_PTR ,_param->_nb_instruction); 70 DELETE1(internal_DECOD_SLOT,_param->_nb_instruction); 71 } 63 72 64 73 for (uint32_t i=0;i<_param->_size_queue; i++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_genMoore.cpp
r132 r136 24 24 log_function(Ifetch_queue,FUNCTION,_name.c_str()); 25 25 26 if (PORT_READ(in_NRESET)) 27 { 28 // ========================================================== 29 // =====[ ADDRESS ]========================================== 30 // ========================================================== 31 { 32 internal_ADDRESS_ACK = (_queue[reg_PTR_WRITE]->_state == IFETCH_QUEUE_STATE_EMPTY); 33 34 log_printf(TRACE,Ifetch_queue,FUNCTION," * ADDRESS_ACK : %d",internal_ADDRESS_ACK); 35 36 if (_param->_have_port_ifetch_queue_ptr) 37 PORT_WRITE(out_ADDRESS_IFETCH_QUEUE_ID, reg_PTR_WRITE); 38 } 39 40 // ========================================================== 41 // =====[ DECOD ]============================================ 42 // ========================================================== 43 { 44 bool ack = (_queue[reg_PTR_READ]->_state == IFETCH_QUEUE_STATE_HAVE_RSP); 45 46 for (uint32_t i=0; i<_param->_nb_instruction; i++) 47 { 48 internal_DECOD_VAL [i] = ack and _queue[reg_PTR_READ]->_instruction_enable [i]; 49 50 log_printf(TRACE,Ifetch_queue,FUNCTION," * DECOD_VAL [%d] : %d",i,internal_DECOD_VAL [i]); 51 52 PORT_WRITE(out_DECOD_INSTRUCTION [i], _queue[reg_PTR_READ]->_instruction [i]); 53 } 54 55 PORT_WRITE(out_DECOD_ADDRESS , _queue[reg_PTR_READ]->_address ); 56 if (_param->_have_port_inst_ifetch_ptr) 57 PORT_WRITE(out_DECOD_INST_IFETCH_PTR , _queue[reg_PTR_READ]->_inst_ifetch_ptr ); 58 PORT_WRITE(out_DECOD_BRANCH_STATE , _queue[reg_PTR_READ]->_branch_state ); 59 if (_param->_have_port_depth) 60 PORT_WRITE(out_DECOD_BRANCH_UPDATE_PREDICTION_ID, _queue[reg_PTR_READ]->_branch_update_prediction_id); 61 PORT_WRITE(out_DECOD_EXCEPTION , _queue[reg_PTR_READ]->_exception ); 62 } 63 } 64 else 65 { 66 // Reset 67 internal_ADDRESS_ACK = 0; 68 for (uint32_t i=0; i<_param->_nb_instruction; i++) 69 internal_DECOD_VAL [i] = 0; 70 71 } 72 73 // Write Output 74 PORT_WRITE(out_ADDRESS_ACK , internal_ADDRESS_ACK); 75 for (uint32_t i=0; i<_param->_nb_instruction; i++) 76 PORT_WRITE(out_DECOD_VAL [i], internal_DECOD_VAL [i]); 26 (this->*function_genMoore) (); 77 27 78 28 log_end(Ifetch_queue,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_transition.cpp
r128 r136 25 25 log_function(Ifetch_queue,FUNCTION,_name.c_str()); 26 26 27 if (PORT_READ(in_NRESET) == 0) 28 { 29 reg_PTR_READ = 0; 30 reg_PTR_WRITE = 0; 31 32 for (uint32_t i=0; i<_param->_size_queue; i++) 33 { 34 _queue [i]->_state = IFETCH_QUEUE_STATE_EMPTY; 35 _queue [i]->_address = 0; // not necessary 36 _queue [i]->_inst_ifetch_ptr = 0; // not necessary 37 _queue [i]->_branch_state = 0; // not necessary 38 _queue [i]->_branch_update_prediction_id = 0; // not necessary 39 _queue [i]->_exception = 0; // not necessary 40 41 for (uint32_t j=0; j<_param->_nb_instruction; j++) 42 { 43 _queue [i]->_instruction [j] = 0; // not necessary 44 _queue [i]->_instruction_enable [j] = 0; // not necessary 45 } 46 } 47 } 48 else 49 { 50 // ========================================================== 51 // =====[ ADDRESS ]========================================== 52 // ========================================================== 53 if (PORT_READ(in_ADDRESS_VAL) and internal_ADDRESS_ACK) 54 { 55 log_printf(TRACE,Ifetch_queue,FUNCTION," * ADDRESS : Transaction"); 56 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_WRITE : %d",reg_PTR_WRITE); 57 log_printf(TRACE,Ifetch_queue,FUNCTION," * ADDRESS : 0x%x",PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS)); 58 59 // New slot in ifetch_queue is allocated 60 61 _queue[reg_PTR_WRITE]->_state = IFETCH_QUEUE_STATE_WAIT_RSP; 62 63 #ifdef STATISTICS 64 if (usage_is_set(_usage,USE_STATISTICS)) 65 (*_sum_transaction_address) ++; 66 #endif 67 68 for (uint32_t i=0; i<_param->_nb_instruction; i++) 69 { 70 Tcontrol_t enable = PORT_READ(in_ADDRESS_INSTRUCTION_ENABLE [i]); 71 #ifdef STATISTICS 72 if (usage_is_set(_usage,USE_STATISTICS)) 73 (*_sum_inst_enable) += enable; 74 #endif 75 _queue[reg_PTR_WRITE]->_instruction_enable [i] = enable; 76 } 77 78 _queue[reg_PTR_WRITE]->_address = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS); 79 _queue[reg_PTR_WRITE]->_inst_ifetch_ptr = (_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR ):0; 80 _queue[reg_PTR_WRITE]->_branch_state = PORT_READ(in_ADDRESS_BRANCH_STATE); 81 _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_depth)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0; 82 83 reg_PTR_WRITE = (reg_PTR_WRITE+1)%_param->_size_queue; 84 } 85 86 // ========================================================== 87 // =====[ DECOD ]============================================ 88 // ========================================================== 89 bool have_instruction_decod = false; 90 bool have_instruction_enable = false; 91 for (uint32_t i=0; i<_param->_nb_instruction; i++) 92 { 93 if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i])) 94 { 95 log_printf(TRACE,Ifetch_queue,FUNCTION," * DECOD [%d] : Transaction",i); 96 97 have_instruction_decod = true; 98 _queue[reg_PTR_READ]->_instruction_enable [i] = false; 99 } 100 have_instruction_enable |= _queue[reg_PTR_READ]->_instruction_enable [i]; 101 } 102 103 // Test if all is decoded 104 if (have_instruction_decod and not have_instruction_enable) 105 { 106 // all is decod 107 _queue[reg_PTR_READ]->_state = IFETCH_QUEUE_STATE_EMPTY; 108 reg_PTR_READ = (reg_PTR_READ+1)%_param->_size_queue; 109 } 110 111 // ========================================================== 112 // =====[ ICACHE_RSP ]======================================= 113 // ========================================================== 114 if (PORT_READ(in_ICACHE_RSP_VAL) and internal_ICACHE_RSP_ACK) 115 { 116 log_printf(TRACE,Ifetch_queue,FUNCTION," * ICACHE_RSP : Transaction"); 117 118 Tpacket_t ptr = (_param->_have_port_ifetch_queue_ptr)?PORT_READ(in_ICACHE_RSP_PACKET_ID):0; 119 120 for (uint32_t i=0; i<_param->_nb_instruction; i++) 121 _queue[ptr]->_instruction [i] = PORT_READ(in_ICACHE_RSP_INSTRUCTION [i]); 122 123 switch (PORT_READ(in_ICACHE_RSP_ERROR)) 124 { 125 case ICACHE_ERROR_NONE : _queue[ptr]->_exception = EXCEPTION_IFETCH_NONE ; break; 126 case ICACHE_ERROR_BUS_ERROR : _queue[ptr]->_exception = EXCEPTION_IFETCH_BUS_ERROR; break; 127 default : ERRORMORPHEO(FUNCTION,"icache_rsp_error : unknow value."); 128 } 129 130 switch (_queue[ptr]->_state) 131 { 132 case IFETCH_QUEUE_STATE_WAIT_RSP : _queue[ptr]->_state = IFETCH_QUEUE_STATE_HAVE_RSP; break; 133 case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : _queue[ptr]->_state = IFETCH_QUEUE_STATE_EMPTY ; break; 134 default : ERRORMORPHEO(FUNCTION,"icache_rsp : invalid ifetch_queue state."); 135 } 136 } 137 138 // ========================================================== 139 // =====[ EVENT_RESET ]====================================== 140 // ========================================================== 141 if (PORT_READ(in_EVENT_RESET_VAL) and internal_EVENT_RESET_ACK) 142 { 143 log_printf(TRACE,Ifetch_queue,FUNCTION," * EVENT_RESET : Transaction"); 144 145 // Scan all entry of queue and test the status 146 for (uint32_t i=0; i<_param->_size_queue; i++) 147 switch (_queue[i]->_state) 148 { 149 case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : break; 150 case IFETCH_QUEUE_STATE_WAIT_RSP : _queue[i]->_state = IFETCH_QUEUE_STATE_ERROR_WAIT_RSP; break; 151 default : _queue[i]->_state = IFETCH_QUEUE_STATE_EMPTY ; break; 152 } 153 154 // all entry is empty (or wait respons to flush) 155 // reset ptr 156 // 1) reg_PTR_READ = reg_PTR_WRITE = = 0 157 // 2) reg_PTR_READ = reg_PTR_WRITE 158 // In method 1), the probalitie than the entry pointed by reg_PTR_WRITE is a slot with state "error_wait_rsp" is more importate that the method 2) 159 reg_PTR_READ = reg_PTR_WRITE; 160 } 161 162 #if defined(DEBUG) and (DEBUG >= DEBUG_TRACE) 163 log_printf(TRACE,Ifetch_queue,FUNCTION," * Dump ifetch_queue"); 164 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_WRITE : %d",reg_PTR_WRITE); 165 log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_READ : %d",reg_PTR_READ ); 166 for (uint32_t i=0; i<_param->_size_queue; i++) 167 { 168 log_printf(TRACE,Ifetch_queue,FUNCTION," * [%d] 0x%.8x (0x%.8x) %d - %d %d %d - %s", 169 i, 170 _queue [i]->_address, 171 _queue [i]->_address<<2, 172 _queue [i]->_inst_ifetch_ptr, 173 _queue [i]->_branch_state, 174 _queue [i]->_branch_update_prediction_id, 175 _queue [i]->_exception, 176 toString(_queue [i]->_state).c_str() 177 ); 178 179 for (uint32_t j=0; j<_param->_nb_instruction; j++) 180 log_printf(TRACE,Ifetch_queue,FUNCTION," * %d 0x%.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]); 181 } 182 #endif 183 184 #ifdef STATISTICS 185 if (usage_is_set(_usage,USE_STATISTICS)) 186 for (uint32_t i=0; i<_param->_size_queue; i++) 187 switch (_queue[i]->_state) 188 { 189 case IFETCH_QUEUE_STATE_EMPTY : break; 190 case IFETCH_QUEUE_STATE_WAIT_RSP : (*_sum_use_queue_wait_rsp ) ++; break; 191 case IFETCH_QUEUE_STATE_HAVE_RSP : (*_sum_use_queue_have_rsp ) ++; break; 192 case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : (*_sum_use_queue_error_wait_rsp) ++; break; 193 default : break; 194 } 195 #endif 196 } 27 (this->*function_transition) (); 197 28 198 29 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters.cpp
r135 r136 19 19 #undef FUNCTION 20 20 #define FUNCTION "Ifetch_queue::Parameters" 21 Parameters::Parameters (uint32_t size_queue , 22 uint32_t nb_instruction , 23 uint32_t size_branch_update_prediction, 24 uint32_t size_general_data , 25 bool is_toplevel) 21 Parameters::Parameters (uint32_t size_queue , 22 Tifetch_queue_scheme_t queue_scheme , 23 uint32_t nb_instruction , 24 uint32_t size_branch_update_prediction, 25 uint32_t size_general_data , 26 bool is_toplevel) 26 27 { 27 28 log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); … … 29 30 _nb_instruction_in_queue = size_queue ; 30 31 _size_queue = size_queue/nb_instruction ; 32 _queue_scheme = queue_scheme ; 31 33 _nb_instruction = nb_instruction ; 32 34 // _size_branch_update_prediction = size_branch_update_prediction; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters_msg_error.cpp
r113 r136 29 29 test.error(_("Size of ifetch queue must be a multiple of nb_instruction.\n")); 30 30 31 switch (_queue_scheme) 32 { 33 case IFETCH_QUEUE_SCHEME_NO_ASSOC : 34 case IFETCH_QUEUE_SCHEME_FULL_ASSOC : 35 { 36 break; 37 } 38 default : 39 { 40 test.error(toString(_("Ifetch queue scheme '%s' is not supported. Please wait a next revision.\n"),toString(_queue_scheme).c_str())); 41 break; 42 } 43 } 44 31 45 if (_size_queue == 1) 32 46 test.warning(_("To best perfomance, size_queue must be > 1.\n")); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters_print.cpp
r88 r136 28 28 xml.balise_open("ifetch_queue"); 29 29 xml.singleton_begin("size_queue "); xml.attribut("value",toString(_size_queue )); xml.singleton_end(); 30 xml.singleton_begin("queue_scheme "); xml.attribut("value",toString(_queue_scheme )); xml.singleton_end(); 30 31 xml.singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction )); xml.singleton_end(); 31 32 // xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end();
Note: See TracChangeset
for help on using the changeset viewer.