Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/SelfTest/Makefile
r81 r88 24 24 library_clean : Address_management_library_clean 25 25 26 local_clean : 27 26 28 include $(DIR_COMPONENT)/Makefile.deps 27 29 include $(DIR_MORPHEO)/Behavioural/Makefile.flags -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/SelfTest/src/main.cpp
r81 r88 44 44 (_nb_instruction , 45 45 _size_address , 46 _size_branch_update_prediction); 46 _size_branch_update_prediction, 47 true // is_toplevel 48 ); 47 49 48 50 msg(_("%s"),param->print(1).c_str()); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/SelfTest/src/test.cpp
r84 r88 24 24 #endif 25 25 26 Tusage_t _usage = USE_ALL; 27 28 // _usage = usage_unset(_usage,USE_SYSTEMC ); 29 // _usage = usage_unset(_usage,USE_VHDL ); 30 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); 31 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); 32 // _usage = usage_unset(_usage,USE_POSITION ); 33 // _usage = usage_unset(_usage,USE_STATISTICS ); 34 // _usage = usage_unset(_usage,USE_INFORMATION ); 35 26 36 Address_management * _Address_management = new Address_management 27 37 (name.c_str(), … … 30 40 #endif 31 41 _param, 32 USE_ALL);42 _usage); 33 43 34 44 #ifdef SYSTEMC … … 62 72 ALLOC_SC_SIGNAL (out_EVENT_ACK ,"out_EVENT_ACK ",Tcontrol_t ); 63 73 ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS ," in_EVENT_ADDRESS ",Tgeneral_address_t); 74 ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS_NEXT ," in_EVENT_ADDRESS_NEXT ",Tgeneral_address_t); 75 ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS_NEXT_VAL ," in_EVENT_ADDRESS_NEXT_VAL ",Tcontrol_t ); 76 ALLOC_SC_SIGNAL ( in_EVENT_IS_DS_TAKE ," in_EVENT_IS_DS_TAKE ",Tcontrol_t ); 64 77 65 78 /******************************************************** … … 76 89 INSTANCE_SC_SIGNAL (_Address_management,out_ADDRESS_INSTRUCTION_ADDRESS ); 77 90 INSTANCE1_SC_SIGNAL(_Address_management,out_ADDRESS_INSTRUCTION_ENABLE ,_param->_nb_instruction); 78 if (_param->_have_port_inst ruction_ptr)91 if (_param->_have_port_inst_ifetch_ptr) 79 92 INSTANCE_SC_SIGNAL (_Address_management,out_ADDRESS_INST_IFETCH_PTR ); 80 93 INSTANCE_SC_SIGNAL (_Address_management,out_ADDRESS_BRANCH_STATE ); 81 if (_param->_have_port_ branch_update_prediction_id)94 if (_param->_have_port_depth) 82 95 INSTANCE_SC_SIGNAL (_Address_management,out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID); 83 96 INSTANCE_SC_SIGNAL (_Address_management,out_PREDICT_VAL ); … … 89 102 INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_PC_NEXT_IS_DS_TAKE ); 90 103 INSTANCE1_SC_SIGNAL(_Address_management, in_PREDICT_INSTRUCTION_ENABLE ,_param->_nb_instruction); 91 if (_param->_have_port_inst ruction_ptr)104 if (_param->_have_port_inst_ifetch_ptr) 92 105 INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_INST_IFETCH_PTR ); 93 106 INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_BRANCH_STATE ); 94 if (_param->_have_port_ branch_update_prediction_id)107 if (_param->_have_port_depth) 95 108 INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_BRANCH_UPDATE_PREDICTION_ID); 96 109 INSTANCE_SC_SIGNAL (_Address_management, in_EVENT_VAL ); 97 110 INSTANCE_SC_SIGNAL (_Address_management,out_EVENT_ACK ); 98 111 INSTANCE_SC_SIGNAL (_Address_management, in_EVENT_ADDRESS ); 112 INSTANCE_SC_SIGNAL (_Address_management, in_EVENT_ADDRESS_NEXT ); 113 INSTANCE_SC_SIGNAL (_Address_management, in_EVENT_ADDRESS_NEXT_VAL ); 114 INSTANCE_SC_SIGNAL (_Address_management, in_EVENT_IS_DS_TAKE ); 99 115 100 116 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 143 159 Tcontrol_t nn_val = false; 144 160 145 Tgeneral_data_t c_addr = 0x100 ;146 Tgeneral_data_t n_addr = 0x100 ;147 Tgeneral_data_t nn_addr = 0x100 ;161 Tgeneral_data_t c_addr = 0x100>>2; 162 Tgeneral_data_t n_addr = 0x100>>2; 163 Tgeneral_data_t nn_addr = 0x100>>2; 148 164 149 165 Tcontrol_t c_enable [_param->_nb_instruction]; … … 159 175 160 176 LABEL("Send Reset"); 161 do 162 { 163 in_EVENT_VAL ->write(1); 164 in_EVENT_ADDRESS->write(n_addr); 165 SC_START(1); 166 } while (out_EVENT_ACK->read() == false); 167 in_EVENT_VAL ->write(0); 177 // do 178 // { 179 // in_EVENT_VAL ->write(1); 180 // in_EVENT_ADDRESS ->write(n_addr); 181 // in_EVENT_ADDRESS_NEXT ->write(nn_addr); 182 // in_EVENT_ADDRESS_NEXT_VAL->write(0); 183 // in_EVENT_IS_DS_TAKE ->write(0); 184 // SC_START(1); 185 // } while (out_EVENT_ACK->read() == false); 186 // in_EVENT_VAL ->write(0); 168 187 169 188 n_val = 1; … … 206 225 } 207 226 208 in_EVENT_VAL ->write((rand()%100)<percent_transaction_event ); 209 in_EVENT_ADDRESS->write(0x100); 227 in_EVENT_VAL ->write((rand()%100)<percent_transaction_event ); 228 in_EVENT_ADDRESS ->write(0x77); 229 in_EVENT_ADDRESS_NEXT ->write(0x171); 230 Tcontrol_t next_val = rand()%2; 231 in_EVENT_ADDRESS_NEXT_VAL->write(next_val); 232 in_EVENT_IS_DS_TAKE ->write(next_val); 210 233 211 234 //------------------------------------------------- … … 238 261 for (uint32_t i=0; i<_param->_nb_instruction; i++) 239 262 TEST(Tcontrol_t ,out_ADDRESS_INSTRUCTION_ENABLE [i] ->read(),c_enable[i]); 240 if (_param->_have_port_inst ruction_ptr)263 if (_param->_have_port_inst_ifetch_ptr) 241 264 TEST(Tinst_ifetch_ptr_t,out_ADDRESS_INST_IFETCH_PTR ->read(),0); 242 265 TEST(Tbranch_state_t ,out_ADDRESS_BRANCH_STATE ->read(),0); 243 if (_param->_have_port_ branch_update_prediction_id)266 if (_param->_have_port_depth) 244 267 TEST(Tprediction_ptr_t ,out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID->read(),0); 245 268 … … 272 295 LABEL("EVENT : Transaction accepted"); 273 296 274 c_val = false; 275 n_val = true; 276 nn_val = false; 277 278 n_addr = in_EVENT_ADDRESS->read(); 279 n_is_ds_take = 0; 297 c_val = false; 298 n_val = true; 299 n_addr = in_EVENT_ADDRESS ->read(); 300 n_is_ds_take = in_EVENT_IS_DS_TAKE ->read(); 301 nn_val = in_EVENT_ADDRESS_NEXT_VAL->read(); 302 nn_addr = in_EVENT_ADDRESS_NEXT ->read(); 303 nn_is_ds_take= false; 304 // nn_val = false; 305 // n_is_ds_take = 0; 280 306 281 307 n_enable [0] = 1; 282 283 308 for (uint32_t i=1; i<_param->_nb_instruction; i++) 309 n_enable [i] = 0; 284 310 } 285 311 … … 347 373 delete out_EVENT_ACK ; 348 374 delete in_EVENT_ADDRESS ; 375 delete in_EVENT_ADDRESS_NEXT ; 376 delete in_EVENT_ADDRESS_NEXT_VAL ; 377 delete in_EVENT_IS_DS_TAKE ; 349 378 #endif 350 379 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/include/Address_management.h
r84 r88 91 91 public : SC_OUT(Tcontrol_t ) * out_EVENT_ACK ; 92 92 public : SC_IN (Tgeneral_address_t) * in_EVENT_ADDRESS ; 93 public : SC_IN (Tgeneral_address_t) * in_EVENT_ADDRESS_NEXT ; 94 public : SC_IN (Tcontrol_t ) * in_EVENT_ADDRESS_NEXT_VAL ; 95 public : SC_IN (Tcontrol_t ) * in_EVENT_IS_DS_TAKE ; 93 96 94 97 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/include/Parameters.h
r81 r88 24 24 //-----[ fields ]------------------------------------------------------------ 25 25 public : uint32_t _nb_instruction ; 26 27 26 //public : uint32_t _size_address ; 27 //public : uint32_t _size_branch_update_prediction; 28 28 29 30 31 32 29 //public : uint32_t _size_instruction_ptr ; 30 // 31 //public : bool _have_port_instruction_ptr ; 32 //public : bool _have_port_branch_update_prediction_id; 33 33 34 34 //-----[ methods ]----------------------------------------------------------- 35 35 public : Parameters (uint32_t nb_instruction, 36 36 uint32_t size_address , 37 uint32_t size_branch_update_prediction); 37 uint32_t size_branch_update_prediction, 38 bool is_toplevel=false); 38 39 39 40 // public : Parameters (Parameters & param) ; 40 41 public : ~Parameters () ; 42 43 public : void copy (void); 41 44 42 45 public : Parameters_test msg_error (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management.cpp
r81 r88 38 38 log_printf(FUNC,Address_management,FUNCTION,"Begin"); 39 39 40 #if DEBUG_Address_management == true 41 log_printf(INFO,Address_management,FUNCTION,_("<%s> Parameters"),_name.c_str()); 42 43 std::cout << *param << std::endl; 44 #endif 45 40 46 log_printf(INFO,Address_management,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,Address_management,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 // Affect output constant … … 94 100 #endif 95 101 } 102 96 103 log_printf(FUNC,Address_management,FUNCTION,"End"); 97 104 }; … … 104 111 105 112 #ifdef STATISTICS 106 if ( _usage & USE_STATISTICS)113 if (usage_is_set(_usage,USE_STATISTICS)) 107 114 { 108 115 statistics_deallocation(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_allocation.cpp
r81 r88 62 62 ALLOC_VALACK_OUT (out_ADDRESS_VAL ,VAL); 63 63 ALLOC_VALACK_IN ( in_ADDRESS_ACK ,ACK); 64 ALLOC_SIGNAL_OUT (out_ADDRESS_INSTRUCTION_ADDRESS ,"instruction_address" ,Tgeneral_address_t,_param->_size_ address);65 ALLOC_SIGNAL_OUT (out_ADDRESS_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst ruction_ptr );64 ALLOC_SIGNAL_OUT (out_ADDRESS_INSTRUCTION_ADDRESS ,"instruction_address" ,Tgeneral_address_t,_param->_size_instruction_address ); 65 ALLOC_SIGNAL_OUT (out_ADDRESS_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr ); 66 66 ALLOC_SIGNAL_OUT (out_ADDRESS_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 67 ALLOC_SIGNAL_OUT (out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);67 ALLOC_SIGNAL_OUT (out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); 68 68 } 69 69 … … 80 80 ALLOC_VALACK_OUT (out_PREDICT_VAL ,VAL); 81 81 ALLOC_VALACK_IN ( in_PREDICT_ACK ,ACK); 82 ALLOC_SIGNAL_OUT (out_PREDICT_PC_PREVIOUS ,"pc_previous" ,Tgeneral_address_t,_param->_size_ address);83 ALLOC_SIGNAL_OUT (out_PREDICT_PC_CURRENT ,"pc_current" ,Tgeneral_address_t,_param->_size_ address);82 ALLOC_SIGNAL_OUT (out_PREDICT_PC_PREVIOUS ,"pc_previous" ,Tgeneral_address_t,_param->_size_instruction_address); 83 ALLOC_SIGNAL_OUT (out_PREDICT_PC_CURRENT ,"pc_current" ,Tgeneral_address_t,_param->_size_instruction_address); 84 84 ALLOC_SIGNAL_OUT (out_PREDICT_PC_CURRENT_IS_DS_TAKE ,"pc_current_is_ds_take" ,Tcontrol_t ,1); 85 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT ,"pc_next" ,Tgeneral_address_t,_param->_size_ address);85 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT ,"pc_next" ,Tgeneral_address_t,_param->_size_instruction_address); 86 86 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT_IS_DS_TAKE ,"pc_next_is_ds_take" ,Tcontrol_t ,1); 87 ALLOC_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst ruction_ptr);87 ALLOC_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr); 88 88 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); 89 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);89 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); 90 90 } 91 91 { … … 99 99 ALLOC_INTERFACE("event", IN, SOUTH, "Event (miss, exception ...)"); 100 100 101 ALLOC_VALACK_IN ( in_EVENT_VAL ,VAL); 102 ALLOC_VALACK_OUT(out_EVENT_ACK ,ACK); 103 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS,"address",Tgeneral_address_t,_param->_size_address); 101 ALLOC_VALACK_IN ( in_EVENT_VAL ,VAL); 102 ALLOC_VALACK_OUT(out_EVENT_ACK ,ACK); 103 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address); 104 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t,_param->_size_instruction_address); 105 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT_VAL,"address_next_val",Tcontrol_t,1); 106 ALLOC_SIGNAL_IN ( in_EVENT_IS_DS_TAKE ,"is_ds_take" ,Tcontrol_t,1); 104 107 } 105 108 109 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 110 if (usage_is_set(_usage,USE_SYSTEMC)) 111 { 112 reg_PC_CURRENT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction]; 113 reg_PC_NEXT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction]; 114 } 115 106 116 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 reg_PC_CURRENT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction];108 reg_PC_NEXT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction];109 110 117 #ifdef POSITION 111 _component->generate_file(); 118 if (usage_is_set(_usage,USE_POSITION)) 119 _component->generate_file(); 112 120 #endif 113 121 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_deallocation.cpp
r81 r88 23 23 log_printf(FUNC,Address_management,FUNCTION,"Begin"); 24 24 25 if ( _usage & USE_SYSTEMC)25 if (usage_is_set(_usage,USE_SYSTEMC)) 26 26 { 27 27 delete in_CLOCK ; … … 32 32 delete out_ADDRESS_INSTRUCTION_ADDRESS ; 33 33 delete [] out_ADDRESS_INSTRUCTION_ENABLE ; 34 if (_param->_have_port_inst ruction_ptr)34 if (_param->_have_port_inst_ifetch_ptr) 35 35 delete out_ADDRESS_INST_IFETCH_PTR ; 36 36 delete out_ADDRESS_BRANCH_STATE ; 37 if (_param->_have_port_ branch_update_prediction_id)37 if (_param->_have_port_depth) 38 38 delete out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID; 39 39 delete out_PREDICT_VAL ; … … 45 45 delete in_PREDICT_PC_NEXT_IS_DS_TAKE ; 46 46 delete [] in_PREDICT_INSTRUCTION_ENABLE ; 47 if (_param->_have_port_inst ruction_ptr)47 if (_param->_have_port_inst_ifetch_ptr) 48 48 delete in_PREDICT_INST_IFETCH_PTR ; 49 49 delete in_PREDICT_BRANCH_STATE ; 50 if (_param->_have_port_ branch_update_prediction_id)50 if (_param->_have_port_depth) 51 51 delete in_PREDICT_BRANCH_UPDATE_PREDICTION_ID; 52 52 delete in_EVENT_VAL ; 53 53 delete out_EVENT_ACK ; 54 54 delete in_EVENT_ADDRESS ; 55 delete in_EVENT_ADDRESS_NEXT ; 56 delete in_EVENT_ADDRESS_NEXT_VAL ; 57 delete in_EVENT_IS_DS_TAKE ; 58 59 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 if (usage_is_set(_usage,USE_SYSTEMC)) 61 { 62 delete reg_PC_CURRENT_INSTRUCTION_ENABLE; 63 delete reg_PC_NEXT_INSTRUCTION_ENABLE ; 64 } 55 65 } 56 66 57 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~58 delete reg_PC_CURRENT_INSTRUCTION_ENABLE;59 delete reg_PC_NEXT_INSTRUCTION_ENABLE ;60 67 61 68 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_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,USE_VHDL_TESTBENCH)) 35 _interfaces->testbench(); 34 36 #endif 35 37 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_genMoore.cpp
r84 r88 32 32 PORT_WRITE(out_ADDRESS_VAL ,internal_ADDRESS_VAL ); 33 33 PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS ,reg_PC_CURRENT ); 34 if (_param->_have_port_inst ruction_ptr)34 if (_param->_have_port_inst_ifetch_ptr) 35 35 PORT_WRITE(out_ADDRESS_INST_IFETCH_PTR ,reg_PC_CURRENT_INST_IFETCH_PTR ); 36 36 PORT_WRITE(out_ADDRESS_BRANCH_STATE ,reg_PC_CURRENT_BRANCH_STATE ); 37 if (_param->_have_port_ branch_update_prediction_id)37 if (_param->_have_port_depth) 38 38 PORT_WRITE(out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID); 39 39 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp
r84 r88 22 22 void Address_management::transition (void) 23 23 { 24 log_printf(FUNC,Address_management,FUNCTION,"Begin"); 24 log_begin(Address_management,FUNCTION); 25 log_function(Address_management,FUNCTION,_name.c_str()); 25 26 26 27 if (PORT_READ(in_NRESET) == 0) … … 28 29 // nothing is valid 29 30 reg_PC_CURRENT_VAL = 0; 30 reg_PC_NEXT_VAL = 0; 31 32 reg_PC_NEXT_VAL = 1; 33 reg_PC_NEXT = 0x100>>2; 34 31 35 reg_PC_NEXT_NEXT_VAL = 0; 32 36 } … … 40 44 for (uint32_t i=0; i<_param->_nb_instruction; i++) 41 45 reg_PC_NEXT_INSTRUCTION_ENABLE [i] = PORT_READ(in_PREDICT_INSTRUCTION_ENABLE [i]); 42 if (_param->_have_port_inst ruction_ptr)46 if (_param->_have_port_inst_ifetch_ptr) 43 47 reg_PC_NEXT_INST_IFETCH_PTR = PORT_READ(in_PREDICT_INST_IFETCH_PTR ); 44 48 reg_PC_NEXT_BRANCH_STATE = PORT_READ(in_PREDICT_BRANCH_STATE ); 45 if (_param->_have_port_ branch_update_prediction_id)49 if (_param->_have_port_depth) 46 50 reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID); 47 51 … … 51 55 52 56 #ifdef STATISTICS 53 (*_stat_nb_transaction_predict) ++; 57 if (usage_is_set(_usage,USE_STATISTICS)) 58 (*_stat_nb_transaction_predict) ++; 54 59 #endif 55 60 } … … 62 67 { 63 68 #ifdef STATISTICS 64 if (reg_PC_CURRENT_VAL) 65 { 66 (*_stat_nb_transaction_address) ++; 67 68 for (uint32_t i=0; i<_param->_nb_instruction; i++) 69 if (reg_PC_CURRENT_INSTRUCTION_ENABLE [i] == true) 70 (*_stat_sum_packet_size) ++; 71 } 69 if (usage_is_set(_usage,USE_STATISTICS)) 70 if (reg_PC_CURRENT_VAL) 71 { 72 (*_stat_nb_transaction_address) ++; 73 74 for (uint32_t i=0; i<_param->_nb_instruction; i++) 75 if (reg_PC_CURRENT_INSTRUCTION_ENABLE [i] == true) 76 (*_stat_sum_packet_size) ++; 77 } 72 78 #endif 73 79 … … 110 116 if (PORT_READ(in_EVENT_VAL) and internal_EVENT_ACK) 111 117 { 112 log_printf(TRACE,Address_management,FUNCTION,"EVENT : Transaction"); 118 log_printf(TRACE,Address_management,FUNCTION," * EVENT : Transaction"); 119 log_printf(TRACE,Address_management,FUNCTION," * IS_DS_TAKE : %d" ,PORT_READ(in_EVENT_IS_DS_TAKE )); 120 log_printf(TRACE,Address_management,FUNCTION," * ADDRESS : %.8x (%.8x)",PORT_READ(in_EVENT_ADDRESS ),PORT_READ(in_EVENT_ADDRESS )<<2); 121 log_printf(TRACE,Address_management,FUNCTION," * ADDRESS_NEXT : %.8x (%.8x)",PORT_READ(in_EVENT_ADDRESS_NEXT ),PORT_READ(in_EVENT_ADDRESS_NEXT )<<2); 122 log_printf(TRACE,Address_management,FUNCTION," * ADDRESS_NEXT_VAL : %d" ,PORT_READ(in_EVENT_ADDRESS_NEXT_VAL)); 113 123 reg_PC_CURRENT_VAL = 0; 114 124 reg_PC_NEXT_VAL = 1; … … 118 128 // * load miss speculation : the load is execute, the event_address is the next address (also the destination of branch) 119 129 // * exception : goto the first instruction of exception handler (also is not in delay slot). 120 reg_PC_NEXT_IS_DS_TAKE = 0; 130 131 reg_PC_NEXT_IS_DS_TAKE = PORT_READ(in_EVENT_IS_DS_TAKE); 121 132 // reg_PC_NEXT_INST_IFETCH_PTR = 0; 122 133 // reg_PC_NEXT_BRANCH_STATE = BRANCH_STATE_NONE; 123 134 // reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = 0; 124 135 125 //reg_PC_NEXT_INSTRUCTION_ENABLE [0] = 1; // only the instruction at the event address is valid, because we have no information on the branch presence in the instruction bundle.126 //for (uint32_t i=1; i<_param->_nb_instruction; i++)127 //reg_PC_NEXT_INSTRUCTION_ENABLE [i] = 0;136 reg_PC_NEXT_INSTRUCTION_ENABLE [0] = 1; // only the instruction at the event address is valid, because we have no information on the branch presence in the instruction bundle. 137 for (uint32_t i=1; i<_param->_nb_instruction; i++) 138 reg_PC_NEXT_INSTRUCTION_ENABLE [i] = 0; 128 139 129 reg_PC_NEXT_NEXT_VAL = 0; // cancel all prediction (event is send at the predict unit) 140 reg_PC_NEXT_NEXT_VAL = PORT_READ(in_EVENT_ADDRESS_NEXT_VAL); 141 reg_PC_NEXT_NEXT = PORT_READ(in_EVENT_ADDRESS_NEXT); 142 reg_PC_NEXT_NEXT_IS_DS_TAKE = 0;//?? 143 144 // Note : is_ds_take = address_next_val 145 // Because, is not ds take, can continue in sequence 146 147 #ifdef DEBUG_TEST 148 if (PORT_READ(in_EVENT_ADDRESS_NEXT_VAL) and not PORT_READ(in_EVENT_IS_DS_TAKE)) 149 throw ERRORMORPHEO(FUNCTION,_("Event : address_next_next_val but next is not a ds take")); 150 #endif 130 151 131 152 #ifdef STATISTICS 132 (*_stat_nb_transaction_event) ++; 153 if (usage_is_set(_usage,USE_STATISTICS)) 154 (*_stat_nb_transaction_event) ++; 133 155 #endif 134 156 } 135 157 } 136 158 137 #if DEBUG >= DEBUG_TRACE138 log_printf(TRACE,Address_management,FUNCTION," Address_Management :");139 log_printf(TRACE,Address_management,FUNCTION," Current : %d %d 0x%x",reg_PC_CURRENT_VAL, reg_PC_CURRENT_IS_DS_TAKE, reg_PC_CURRENT);140 log_printf(TRACE,Address_management,FUNCTION," Next : %d %d 0x%x",reg_PC_NEXT_VAL, reg_PC_NEXT_IS_DS_TAKE, reg_PC_NEXT);141 log_printf(TRACE,Address_management,FUNCTION," Next_Next : %d %d 0x%x",reg_PC_NEXT_NEXT_VAL, reg_PC_NEXT_NEXT_IS_DS_TAKE, reg_PC_NEXT_NEXT);159 #if defined(DEBUG) and (DEBUG >= DEBUG_TRACE) 160 log_printf(TRACE,Address_management,FUNCTION," * Dump PC"); 161 log_printf(TRACE,Address_management,FUNCTION," * Current : %d %d 0x%.8x (%.8x)",reg_PC_CURRENT_VAL , reg_PC_CURRENT_IS_DS_TAKE , reg_PC_CURRENT , reg_PC_CURRENT <<2); 162 log_printf(TRACE,Address_management,FUNCTION," * Next : %d %d 0x%.8x (%.8x)",reg_PC_NEXT_VAL , reg_PC_NEXT_IS_DS_TAKE , reg_PC_NEXT , reg_PC_NEXT <<2); 163 log_printf(TRACE,Address_management,FUNCTION," * Next_Next : %d %d 0x%.8x (%.8x)",reg_PC_NEXT_NEXT_VAL, reg_PC_NEXT_NEXT_IS_DS_TAKE, reg_PC_NEXT_NEXT, reg_PC_NEXT_NEXT<<2); 142 164 #endif 143 165 … … 145 167 end_cycle (); 146 168 #endif 147 148 log_ printf(FUNC,Address_management,FUNCTION,"End");169 170 log_end(Address_management,FUNCTION); 149 171 }; 150 172 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Parameters.cpp
r81 r88 21 21 Parameters::Parameters (uint32_t nb_instruction, 22 22 uint32_t size_address , 23 uint32_t size_branch_update_prediction) 23 uint32_t size_branch_update_prediction, 24 bool is_toplevel) 24 25 { 25 26 log_printf(FUNC,Address_management,FUNCTION,"Begin"); 26 27 27 _nb_instruction = nb_instruction ; 28 _size_address = size_address ; 29 _size_branch_update_prediction = size_branch_update_prediction; 30 31 _size_instruction_ptr = log2(nb_instruction); 32 33 _have_port_instruction_ptr = _size_instruction_ptr > 0; 34 _have_port_branch_update_prediction_id = size_branch_update_prediction > 0; 28 _nb_instruction = nb_instruction ; 35 29 36 30 test(); 31 32 if (is_toplevel) 33 { 34 _size_instruction_address = size_address ; 35 _size_depth = size_branch_update_prediction; 36 _size_inst_ifetch_ptr = log2(nb_instruction); 37 38 _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; 39 _have_port_depth = _size_depth > 0; 40 41 copy(); 42 } 43 37 44 log_printf(FUNC,Address_management,FUNCTION,"End"); 38 45 }; … … 55 62 }; 56 63 64 #undef FUNCTION 65 #define FUNCTION "Address_management::copy" 66 void Parameters::copy (void) 67 { 68 log_printf(FUNC,Address_management,FUNCTION,"Begin"); 69 log_printf(FUNC,Address_management,FUNCTION,"End"); 70 }; 71 57 72 }; // end namespace address_management 58 73 }; // end namespace ifetch_unit -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Parameters_print.cpp
r81 r88 24 24 log_printf(FUNC,Address_management,FUNCTION,"Begin"); 25 25 26 XML xml ("address_management");26 // XML xml ("address_management"); 27 27 28 xml.balise_open("address_management"); 29 xml.singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction )); xml.singleton_end(); 30 xml.singleton_begin("size_address "); xml.attribut("value",toString(_size_address )); xml.singleton_end(); 31 xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end(); 32 xml.balise_close(); 28 // xml.balise_open("address_management"); 29 // xml.singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction )); xml.singleton_end(); 30 // // xml.singleton_begin("size_address "); xml.attribut("value",toString(_size_address )); xml.singleton_end(); 31 // // xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end(); 32 // xml.balise_close(); 33 34 // return xml.get_body(depth); 35 36 std::string str = ""; 33 37 34 38 log_printf(FUNC,Address_management,FUNCTION,"End"); 35 36 return xml.get_body(depth);39 40 return str; 37 41 }; 38 42 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/Makefile
r81 r88 24 24 library_clean : Ifetch_queue_library_clean 25 25 26 local_clean : 27 26 28 include $(DIR_COMPONENT)/Makefile.deps 27 29 include $(DIR_MORPHEO)/Behavioural/Makefile.flags -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/src/main.cpp
r81 r88 47 47 _nb_instruction , 48 48 _size_branch_update_prediction , 49 _size_general_data ); 49 _size_general_data , 50 true // is_toplevel 51 ); 50 52 51 53 msg(_("%s"),param->print(1).c_str()); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/src/test.cpp
r82 r88 41 41 #endif 42 42 43 Tusage_t _usage = USE_ALL; 44 45 // _usage = usage_unset(_usage,USE_SYSTEMC ); 46 // _usage = usage_unset(_usage,USE_VHDL ); 47 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); 48 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); 49 // _usage = usage_unset(_usage,USE_POSITION ); 50 // _usage = usage_unset(_usage,USE_STATISTICS ); 51 // _usage = usage_unset(_usage,USE_INFORMATION ); 52 43 53 Ifetch_queue * _Ifetch_queue = new Ifetch_queue 44 54 (name.c_str(), … … 47 57 #endif 48 58 _param, 49 USE_ALL);59 _usage); 50 60 51 61 #ifdef SYSTEMC … … 93 103 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ADDRESS_VAL ); 94 104 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_ADDRESS_ACK ); 95 if (_param->_have_port_ queue_ptr)105 if (_param->_have_port_ifetch_queue_ptr) 96 106 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_ADDRESS_IFETCH_QUEUE_ID ); 97 107 INSTANCE1_SC_SIGNAL(_Ifetch_queue, in_ADDRESS_INSTRUCTION_ENABLE ,_param->_nb_instruction); 98 108 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ADDRESS_INSTRUCTION_ADDRESS ); 99 if (_param->_have_port_inst ruction_ptr)109 if (_param->_have_port_inst_ifetch_ptr) 100 110 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ADDRESS_INST_IFETCH_PTR ); 101 111 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ADDRESS_BRANCH_STATE ); 102 if (_param->_have_port_ branch_update_prediction_id)112 if (_param->_have_port_depth) 103 113 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID); 104 114 INSTANCE1_SC_SIGNAL(_Ifetch_queue,out_DECOD_VAL ,_param->_nb_instruction); … … 106 116 INSTANCE1_SC_SIGNAL(_Ifetch_queue,out_DECOD_INSTRUCTION ,_param->_nb_instruction); 107 117 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_DECOD_ADDRESS ); 108 if (_param->_have_port_inst ruction_ptr)118 if (_param->_have_port_inst_ifetch_ptr) 109 119 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_DECOD_INST_IFETCH_PTR ); 110 120 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_DECOD_BRANCH_STATE ); 111 if (_param->_have_port_ branch_update_prediction_id)121 if (_param->_have_port_depth) 112 122 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_DECOD_BRANCH_UPDATE_PREDICTION_ID ); 113 123 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_DECOD_EXCEPTION ); 114 124 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ICACHE_RSP_VAL ); 115 125 INSTANCE_SC_SIGNAL (_Ifetch_queue,out_ICACHE_RSP_ACK ); 116 if (_param->_have_port_ queue_ptr)126 if (_param->_have_port_ifetch_queue_ptr) 117 127 INSTANCE_SC_SIGNAL (_Ifetch_queue, in_ICACHE_RSP_PACKET_ID ); 118 128 INSTANCE1_SC_SIGNAL(_Ifetch_queue, in_ICACHE_RSP_INSTRUCTION ,_param->_nb_instruction); … … 180 190 for (uint32_t i=0; i<_param->_nb_instruction; i++) 181 191 in_ADDRESS_INSTRUCTION_ENABLE [i] ->write(i<=nb_inst_enable); 182 if (_param->_have_port_inst ruction_ptr)192 if (_param->_have_port_inst_ifetch_ptr) 183 193 in_ADDRESS_INST_IFETCH_PTR ->write(address%_param->_nb_instruction); 184 194 in_ADDRESS_BRANCH_STATE ->write(address%SIZE_BRANCH_STATE); 185 if (_param->_have_port_ branch_update_prediction_id)186 in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID ->write(address%_param->_size_ branch_update_prediction);195 if (_param->_have_port_depth) 196 in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID ->write(address%_param->_size_depth); 187 197 188 198 // ===== … … 241 251 242 252 list_wait_decod.push_back(address); 243 // list_req_icache.insert(, entry_t((_param->_have_port_ queue_ptr)?out_ADDRESS_IFETCH_QUEUE_ID->read():0,address));253 // list_req_icache.insert(, entry_t((_param->_have_port_ifetch_queue_ptr)?out_ADDRESS_IFETCH_QUEUE_ID->read():0,address)); 244 254 245 255 uint32_t cycle = ((rand()%100)<percent_icache_hit)?1:icache_miss_penality; … … 252 262 253 263 LABEL(" * list_req_icache : %d",list_req_icache.size()); 254 list_req_icache.insert(it,entry_t(cycle,(_param->_have_port_ queue_ptr)?out_ADDRESS_IFETCH_QUEUE_ID->read():0,address));264 list_req_icache.insert(it,entry_t(cycle,(_param->_have_port_ifetch_queue_ptr)?out_ADDRESS_IFETCH_QUEUE_ID->read():0,address)); 255 265 LABEL(" * list_req_icache : %d",list_req_icache.size()); 256 266 address += 4*_param->_nb_instruction; … … 292 302 TEST(Tgeneral_data_t ,out_DECOD_ADDRESS ->read(), addr); 293 303 TEST(Tbranch_state_t ,out_DECOD_BRANCH_STATE ->read(),addr%SIZE_BRANCH_STATE); 294 if (_param->_have_port_inst ruction_ptr)304 if (_param->_have_port_inst_ifetch_ptr) 295 305 TEST(Tinst_ifetch_ptr_t,out_DECOD_INST_IFETCH_PTR ->read(),addr%_param->_nb_instruction); 296 if (_param->_have_port_ branch_update_prediction_id)297 TEST(Tprediction_ptr_t ,out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(),addr%_param->_size_ branch_update_prediction);306 if (_param->_have_port_depth) 307 TEST(Tprediction_ptr_t ,out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(),addr%_param->_size_depth); 298 308 if ((addr % modulo_iberr) == 0) 299 309 TEST(Texception_t ,out_DECOD_EXCEPTION ->read(),EXCEPTION_IFETCH_BUS_ERROR); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Parameters.h
r81 r88 26 26 public : uint32_t _size_queue ; 27 27 public : uint32_t _nb_instruction ; 28 29 28 //public : uint32_t _size_branch_update_prediction ; 29 //public : uint32_t _size_general_data ; 30 30 31 32 31 //public : uint32_t _size_queue_ptr ; 32 //public : uint32_t _size_instruction_ptr ; 33 33 34 35 36 34 //public : bool _have_port_queue_ptr ; 35 //public : bool _have_port_instruction_ptr ; 36 //public : bool _have_port_branch_update_prediction_id; 37 37 38 38 //-----[ methods ]----------------------------------------------------------- 39 public : Parameters (uint32_t _size_queue , 40 uint32_t _nb_instruction , 41 uint32_t _size_branch_update_prediction, 42 uint32_t _size_general_data ); 39 public : Parameters (uint32_t size_queue , 40 uint32_t nb_instruction , 41 uint32_t size_branch_update_prediction, 42 uint32_t size_general_data , 43 bool is_toplevel=false); 43 44 // public : Parameters (Parameters & param) ; 44 45 public : ~Parameters () ; 46 47 public : void copy (void); 45 48 46 49 public : Parameters_test msg_error (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue.cpp
r81 r88 38 38 log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); 39 39 40 log_printf(INFO,Ifetch_queue,FUNCTION,"Allocation"); 40 #if DEBUG_Ifetch_queue == true 41 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); 42 43 std::cout << *param << std::endl; 44 #endif 45 46 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Allocation"),_name.c_str()); 41 47 42 48 allocation ( … … 47 53 48 54 #ifdef STATISTICS 49 if ( _usage & USE_STATISTICS)55 if (usage_is_set(_usage,USE_STATISTICS)) 50 56 { 51 log_printf(INFO,Ifetch_queue,FUNCTION, "Allocation of statistics");57 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str()); 52 58 53 59 statistics_allocation(param_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 61 log_printf(INFO,Ifetch_queue,FUNCTION, "Generate the vhdl");67 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); 62 68 63 69 vhdl(); … … 66 72 67 73 #ifdef SYSTEMC 68 if ( _usage & USE_SYSTEMC)74 if (usage_is_set(_usage,USE_SYSTEMC)) 69 75 { 70 76 // constant output … … 75 81 PORT_WRITE(out_EVENT_RESET_ACK, internal_EVENT_RESET_ACK); 76 82 77 log_printf(INFO,Ifetch_queue,FUNCTION, "Method - transition");83 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str()); 78 84 79 85 SC_METHOD (transition); … … 85 91 # endif 86 92 87 log_printf(INFO,Ifetch_queue,FUNCTION, "Method - genMoore");93 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str()); 88 94 89 95 SC_METHOD (genMoore); … … 107 113 108 114 #ifdef STATISTICS 109 if ( _usage & USE_STATISTICS)115 if (usage_is_set(_usage,USE_STATISTICS)) 110 116 { 111 117 statistics_deallocation(); … … 113 119 #endif 114 120 115 log_printf(INFO,Ifetch_queue,FUNCTION, "Deallocation");121 log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str()); 116 122 deallocation (); 117 123 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_allocation.cpp
r81 r88 62 62 ALLOC_VALACK_IN ( in_ADDRESS_VAL ,VAL); 63 63 ALLOC_VALACK_OUT(out_ADDRESS_ACK ,ACK); 64 ALLOC_SIGNAL_IN ( in_ADDRESS_INSTRUCTION_ADDRESS ,"instruction_address" ,Tgeneral_address_t ,_param->_size_ general_data);65 ALLOC_SIGNAL_IN ( in_ADDRESS_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t ,_param->_size_inst ruction_ptr);66 ALLOC_SIGNAL_IN ( in_ADDRESS_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state 67 ALLOC_SIGNAL_IN ( in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);68 ALLOC_SIGNAL_OUT(out_ADDRESS_IFETCH_QUEUE_ID ,"ifetch_queue_id" ,Tifetch_queue_ptr_t,_param->_size_ queue_ptr);64 ALLOC_SIGNAL_IN ( in_ADDRESS_INSTRUCTION_ADDRESS ,"instruction_address" ,Tgeneral_address_t ,_param->_size_instruction_address ); 65 ALLOC_SIGNAL_IN ( in_ADDRESS_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr); 66 ALLOC_SIGNAL_IN ( in_ADDRESS_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 67 ALLOC_SIGNAL_IN ( in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth ); 68 ALLOC_SIGNAL_OUT(out_ADDRESS_IFETCH_QUEUE_ID ,"ifetch_queue_id" ,Tifetch_queue_ptr_t,_param->_size_ifetch_queue_ptr); 69 69 70 70 } … … 86 86 ALLOC_INTERFACE("decod",OUT, EAST, "Send instruction bundle to the decod's stage."); 87 87 88 ALLOC_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_ general_data);89 ALLOC_SIGNAL_OUT(out_DECOD_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst ruction_ptr);90 ALLOC_SIGNAL_OUT(out_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state 91 ALLOC_SIGNAL_OUT(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);92 ALLOC_SIGNAL_OUT(out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch 88 ALLOC_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address ); 89 ALLOC_SIGNAL_OUT(out_DECOD_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr ); 90 ALLOC_SIGNAL_OUT(out_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); 91 ALLOC_SIGNAL_OUT(out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth ); 92 ALLOC_SIGNAL_OUT(out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch); 93 93 } 94 94 … … 99 99 ALLOC_VALACK_IN ( in_ICACHE_RSP_VAL ,VAL); 100 100 ALLOC_VALACK_OUT(out_ICACHE_RSP_ACK ,ACK); 101 ALLOC_SIGNAL_IN ( in_ICACHE_RSP_PACKET_ID,"packet_id",Tpacket_t ,_param->_size_ queue_ptr);101 ALLOC_SIGNAL_IN ( in_ICACHE_RSP_PACKET_ID,"packet_id",Tpacket_t ,_param->_size_ifetch_queue_ptr); 102 102 ALLOC_SIGNAL_IN ( in_ICACHE_RSP_ERROR ,"error" ,Ticache_error_t,_param->_size_icache_error); 103 103 } … … 117 117 118 118 // ~~~~~[ Internal ] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 internal_DECOD_VAL = new Tcontrol_t [_param->_nb_instruction]; 120 121 _queue = new ifetch_queue_entry_t * [_param->_size_queue]; 122 for (uint32_t i=0;i<_param->_size_queue; i++) 123 _queue [i] = new ifetch_queue_entry_t (_param->_nb_instruction); 119 if (usage_is_set(_usage,USE_SYSTEMC)) 120 { 121 internal_DECOD_VAL = new Tcontrol_t [_param->_nb_instruction]; 122 123 _queue = new ifetch_queue_entry_t * [_param->_size_queue]; 124 for (uint32_t i=0;i<_param->_size_queue; i++) 125 _queue [i] = new ifetch_queue_entry_t (_param->_nb_instruction); 126 } 124 127 125 128 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 126 129 127 130 #ifdef POSITION 128 _component->generate_file(); 131 if (usage_is_set(_usage,USE_POSITION)) 132 _component->generate_file(); 129 133 #endif 130 134 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_deallocation.cpp
r81 r88 23 23 log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); 24 24 25 if ( _usage & USE_SYSTEMC)25 if (usage_is_set(_usage,USE_SYSTEMC)) 26 26 { 27 27 delete in_CLOCK ; … … 30 30 delete in_ADDRESS_VAL ; 31 31 delete out_ADDRESS_ACK ; 32 if (_param->_have_port_ queue_ptr)32 if (_param->_have_port_ifetch_queue_ptr) 33 33 delete out_ADDRESS_IFETCH_QUEUE_ID ; 34 34 delete [] in_ADDRESS_INSTRUCTION_ENABLE ; 35 35 delete in_ADDRESS_INSTRUCTION_ADDRESS ; 36 if (_param->_have_port_inst ruction_ptr)36 if (_param->_have_port_inst_ifetch_ptr) 37 37 delete in_ADDRESS_INST_IFETCH_PTR ; 38 38 delete in_ADDRESS_BRANCH_STATE ; 39 if (_param->_have_port_ branch_update_prediction_id)39 if (_param->_have_port_depth) 40 40 delete in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID; 41 41 delete [] out_DECOD_VAL ; … … 43 43 delete [] out_DECOD_INSTRUCTION ; 44 44 delete out_DECOD_ADDRESS ; 45 if (_param->_have_port_inst ruction_ptr)45 if (_param->_have_port_inst_ifetch_ptr) 46 46 delete out_DECOD_INST_IFETCH_PTR ; 47 47 delete out_DECOD_BRANCH_STATE ; 48 if (_param->_have_port_ branch_update_prediction_id)48 if (_param->_have_port_depth) 49 49 delete out_DECOD_BRANCH_UPDATE_PREDICTION_ID ; 50 50 delete out_DECOD_EXCEPTION ; 51 51 delete in_ICACHE_RSP_VAL ; 52 52 delete out_ICACHE_RSP_ACK ; 53 if (_param->_have_port_ queue_ptr)53 if (_param->_have_port_ifetch_queue_ptr) 54 54 delete in_ICACHE_RSP_PACKET_ID ; 55 55 delete [] in_ICACHE_RSP_INSTRUCTION ; … … 58 58 delete out_EVENT_RESET_ACK ; 59 59 } 60 61 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 if (usage_is_set(_usage,USE_SYSTEMC)) 63 { 64 delete internal_DECOD_VAL; 65 delete [] _queue; 66 } 67 60 68 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 61 62 delete internal_DECOD_VAL;63 delete [] _queue;64 69 delete _component; 65 70 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_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,USE_VHDL_TESTBENCH)) 35 _interfaces->testbench(); 34 36 #endif 35 37 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_genMoore.cpp
r81 r88 29 29 30 30 PORT_WRITE(out_ADDRESS_ACK , internal_ADDRESS_ACK); 31 if (_param->_have_port_ queue_ptr)31 if (_param->_have_port_ifetch_queue_ptr) 32 32 PORT_WRITE(out_ADDRESS_IFETCH_QUEUE_ID, reg_PTR_WRITE); 33 33 … … 45 45 46 46 PORT_WRITE(out_DECOD_ADDRESS , _queue[reg_PTR_READ]->_address ); 47 if (_param->_have_port_inst ruction_ptr)47 if (_param->_have_port_inst_ifetch_ptr) 48 48 PORT_WRITE(out_DECOD_INST_IFETCH_PTR , _queue[reg_PTR_READ]->_inst_ifetch_ptr ); 49 49 PORT_WRITE(out_DECOD_BRANCH_STATE , _queue[reg_PTR_READ]->_branch_state ); 50 if (_param->_have_port_ branch_update_prediction_id)50 if (_param->_have_port_depth) 51 51 PORT_WRITE(out_DECOD_BRANCH_UPDATE_PREDICTION_ID, _queue[reg_PTR_READ]->_branch_update_prediction_id); 52 52 PORT_WRITE(out_DECOD_EXCEPTION , _queue[reg_PTR_READ]->_exception ); -
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 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters.cpp
r81 r88 22 22 uint32_t nb_instruction , 23 23 uint32_t size_branch_update_prediction, 24 uint32_t size_general_data ) 24 uint32_t size_general_data , 25 bool is_toplevel) 25 26 { 26 27 log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); … … 28 29 _size_queue = size_queue ; 29 30 _nb_instruction = nb_instruction ; 30 31 31 // _size_branch_update_prediction = size_branch_update_prediction; 32 // _size_general_data = size_general_data ; 32 33 33 _size_queue_ptr = log2(size_queue); 34 _size_instruction_ptr = log2(nb_instruction); 34 test(); 35 35 36 _have_port_queue_ptr = _size_queue_ptr > 0; 37 _have_port_instruction_ptr = _size_instruction_ptr > 0; 38 _have_port_branch_update_prediction_id = size_branch_update_prediction > 0; 39 40 test(); 36 if (is_toplevel) 37 { 38 _size_instruction_address = size_general_data; 39 _size_ifetch_queue_ptr = log2(size_queue); 40 _size_inst_ifetch_ptr = log2(nb_instruction); 41 _size_depth = size_branch_update_prediction; 42 43 _have_port_ifetch_queue_ptr = _size_ifetch_queue_ptr > 0; 44 _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; 45 _have_port_depth = _size_depth > 0; 46 47 copy (); 48 } 49 41 50 log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); 42 51 }; … … 59 68 }; 60 69 70 #undef FUNCTION 71 #define FUNCTION "Ifetch_queue::copy" 72 void Parameters::copy (void) 73 { 74 log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); 75 log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); 76 }; 77 61 78 }; // end namespace ifetch_queue 62 79 }; // end namespace ifetch_unit -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters_msg_error.cpp
r81 r88 28 28 29 29 if (_size_queue == 1) 30 test.warning("To best perfomance, size_queue must be > 1. ");30 test.warning("To best perfomance, size_queue must be > 1.\n"); 31 31 32 // if (not _have_port_queue_ptr)33 // test.information("They have not port '..._QUEUE_PTR'.");34 35 // if (not _have_port_instruction_ptr)36 // test.information("They have not port '..._INST_IFETCH_PTR'.");37 38 // if (not _have_port_branch_update_prediction_id)39 // test.information("They have not port '..._BRANCH_UPDATE_PREDICTION_ID'.");40 41 32 log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); 42 33 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Parameters_print.cpp
r81 r88 29 29 xml.singleton_begin("size_queue "); xml.attribut("value",toString(_size_queue )); xml.singleton_end(); 30 30 xml.singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction )); xml.singleton_end(); 31 32 31 // xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end(); 32 // xml.singleton_begin("size_general_data "); xml.attribut("value",toString(_size_general_data )); xml.singleton_end(); 33 33 xml.balise_close(); 34 34 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/SelfTest/Makefile
r81 r88 24 24 library_clean : Ifetch_unit_Glue_library_clean 25 25 26 local_clean : 27 26 28 include $(DIR_COMPONENT)/Makefile.deps 27 29 include $(DIR_MORPHEO)/Behavioural/Makefile.flags -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/SelfTest/src/main.cpp
r85 r88 37 37 { 38 38 morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_unit_glue::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_unit_glue::Parameters 39 (_size_address); 39 (_size_address, 40 true //is_toplevel 41 ); 40 42 41 43 msg(_("%s"),param->print(1).c_str()); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/SelfTest/src/test.cpp
r85 r88 23 23 #endif 24 24 25 Tusage_t _usage = USE_ALL; 26 27 // _usage = usage_unset(_usage,USE_SYSTEMC ); 28 // _usage = usage_unset(_usage,USE_VHDL ); 29 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); 30 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); 31 // _usage = usage_unset(_usage,USE_POSITION ); 32 // _usage = usage_unset(_usage,USE_STATISTICS ); 33 // _usage = usage_unset(_usage,USE_INFORMATION ); 34 25 35 Ifetch_unit_Glue * _Ifetch_unit_Glue = new Ifetch_unit_Glue 26 36 (name.c_str(), … … 29 39 #endif 30 40 _param, 31 USE_ALL);41 _usage); 32 42 33 43 #ifdef SYSTEMC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/include/Parameters.h
r85 r88 24 24 { 25 25 //-----[ fields ]------------------------------------------------------------ 26 26 //public : uint32_t _size_address; 27 27 28 28 //-----[ methods ]----------------------------------------------------------- 29 public : Parameters (uint32_t size_address); 29 public : Parameters (uint32_t size_address, 30 bool is_toplevel=false); 30 31 // public : Parameters (Parameters & param) ; 31 32 public : ~Parameters () ; 33 34 public : void copy (void); 32 35 33 36 public : Parameters_test msg_error (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue.cpp
r85 r88 38 38 log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin"); 39 39 40 #if DEBUG_Ifetch_unit_Glue == true 41 log_printf(INFO,Ifetch_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str()); 42 43 std::cout << *param << std::endl; 44 #endif 45 40 46 log_printf(INFO,Ifetch_unit_Glue,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,Ifetch_unit_Glue,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 PORT_WRITE(out_ICACHE_REQ_TYPE,ICACHE_TYPE_LOAD); 74 if (usage_is_set(_usage,USE_SYSTEMC)) 75 { 76 // Write constant 77 PORT_WRITE(out_ICACHE_REQ_TYPE,ICACHE_TYPE_LOAD); 69 78 70 if (_usage & USE_SYSTEMC)71 {72 79 # if defined(STATISTICS) or defined(VHDL_TESTBENCH) 73 80 log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - transition"); … … 140 147 141 148 #ifdef STATISTICS 142 if ( _usage & USE_STATISTICS)149 if (usage_is_set(_usage,USE_STATISTICS)) 143 150 { 144 151 statistics_deallocation(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue_allocation.cpp
r85 r88 67 67 ALLOC_SIGNAL_IN ( in_ICACHE_REQ_QUEUE_ACK ,"queue_ack" ,Tcontrol_t,1); 68 68 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_TYPE ,"type" ,Ticache_type_t,_param->_size_icache_type); 69 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_ADDRESS ,"address" ,Taddress_t,_param->_size_ address);70 ALLOC_SIGNAL_IN ( in_ICACHE_REQ_ADDRESS_ADDRESS,"address_address",Taddress_t,_param->_size_ address);71 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_QUEUE_ADDRESS ,"queue_address" ,Taddress_t,_param->_size_ address);69 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_ADDRESS ,"address" ,Taddress_t,_param->_size_instruction_address); 70 ALLOC_SIGNAL_IN ( in_ICACHE_REQ_ADDRESS_ADDRESS,"address_address",Taddress_t,_param->_size_instruction_address); 71 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_QUEUE_ADDRESS ,"queue_address" ,Taddress_t,_param->_size_instruction_address); 72 72 } 73 73 … … 87 87 88 88 #ifdef POSITION 89 _component->generate_file(); 89 if (usage_is_set(_usage,USE_POSITION)) 90 _component->generate_file(); 90 91 #endif 91 92 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue_deallocation.cpp
r85 r88 23 23 log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin"); 24 24 25 if ( _usage & USE_SYSTEMC)25 if (usage_is_set(_usage,USE_SYSTEMC)) 26 26 { 27 27 delete in_CLOCK ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue_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,USE_VHDL_TESTBENCH)) 35 _interfaces->testbench(); 34 36 #endif 35 37 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Parameters.cpp
r85 r88 19 19 #undef FUNCTION 20 20 #define FUNCTION "Ifetch_unit_Glue::Parameters" 21 Parameters::Parameters (uint32_t size_address) 21 Parameters::Parameters (uint32_t size_address, 22 bool is_toplevel) 22 23 { 23 24 log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin"); 24 25 25 _size_address = size_address;26 test(); 26 27 27 test(); 28 if (is_toplevel) 29 { 30 _size_instruction_address = size_address; 31 32 copy (); 33 } 34 28 35 log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End"); 29 36 }; … … 46 53 }; 47 54 55 #undef FUNCTION 56 #define FUNCTION "Ifetch_unit_Glue::copy" 57 void Parameters::copy (void) 58 { 59 log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin"); 60 log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End"); 61 }; 62 48 63 }; // end namespace ifetch_unit_glue 49 64 }; // end namespace ifetch_unit -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Parameters_print.cpp
r85 r88 27 27 28 28 xml.balise_open("ifetch_unit_glue"); 29 29 // xml.singleton_begin("size_address"); xml.attribut("value",toString(_size_address)); xml.singleton_end(); 30 30 xml.balise_close(); 31 31 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/SelfTest/Makefile
r81 r88 24 24 library_clean : Ifetch_unit_library_clean 25 25 26 local_clean : 27 26 28 include $(DIR_COMPONENT)/Makefile.deps 27 29 include $(DIR_MORPHEO)/Behavioural/Makefile.flags -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/SelfTest/src/main.cpp
r81 r88 47 47 _nb_instruction , 48 48 _size_branch_update_prediction , 49 _size_general_data ); 49 _size_general_data , 50 true // is_toplevel 51 ); 50 52 51 53 msg(_("%s"),param->print(1).c_str()); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/SelfTest/src/test.cpp
r85 r88 7 7 */ 8 8 9 #define NB_ITERATION 1 289 #define NB_ITERATION 1024 10 10 #define CYCLE_MAX (128*NB_ITERATION) 11 11 … … 40 40 #endif 41 41 42 Tusage_t _usage = USE_ALL; 43 // _usage = usage_unset(_usage,USE_SYSTEMC ); 44 // _usage = usage_unset(_usage,USE_VHDL ); 45 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); 46 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); 47 // _usage = usage_unset(_usage,USE_POSITION ); 48 _usage = usage_unset(_usage,USE_STATISTICS ); 49 // _usage = usage_unset(_usage,USE_INFORMATION ); 50 42 51 Ifetch_unit * _Ifetch_unit = new Ifetch_unit 43 52 (name.c_str(), … … 46 55 #endif 47 56 _param, 48 USE_ALL);57 _usage); 49 58 50 59 #ifdef SYSTEMC … … 92 101 ALLOC_SC_SIGNAL (out_EVENT_ACK ,"out_EVENT_ACK ",Tcontrol_t ); 93 102 ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS ," in_EVENT_ADDRESS ",Tgeneral_address_t ); 103 ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS_NEXT ," in_EVENT_ADDRESS_NEXT ",Tgeneral_address_t ); 104 ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS_NEXT_VAL ," in_EVENT_ADDRESS_NEXT_VAL ",Tcontrol_t ); 105 ALLOC_SC_SIGNAL ( in_EVENT_IS_DS_TAKE ," in_EVENT_IS_DS_TAKE ",Tcontrol_t ); 94 106 95 107 /******************************************************** … … 105 117 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_ICACHE_REQ_ACK ); 106 118 //INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_REQ_THREAD_ID ); 107 if (_param->_have_port_ queue_ptr)119 if (_param->_have_port_ifetch_queue_ptr) 108 120 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_REQ_PACKET_ID ); 109 121 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_REQ_ADDRESS ); … … 112 124 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_RSP_ACK ); 113 125 //INSTANCE_SC_SIGNAL (_Ifetch_unit, in_ICACHE_RSP_THREAD_ID ); 114 if (_param->_have_port_ queue_ptr)126 if (_param->_have_port_ifetch_queue_ptr) 115 127 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_ICACHE_RSP_PACKET_ID ); 116 128 INSTANCE1_SC_SIGNAL(_Ifetch_unit, in_ICACHE_RSP_INSTRUCTION ,_param->_nb_instruction); … … 124 136 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_PC_NEXT_IS_DS_TAKE ); 125 137 INSTANCE1_SC_SIGNAL(_Ifetch_unit, in_PREDICT_INSTRUCTION_ENABLE ,_param->_nb_instruction); 126 if (_param->_have_port_inst ruction_ptr)138 if (_param->_have_port_inst_ifetch_ptr) 127 139 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_INST_IFETCH_PTR ); 128 140 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_BRANCH_STATE ); 129 if (_param->_have_port_ branch_update_prediction_id)141 if (_param->_have_port_depth) 130 142 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_BRANCH_UPDATE_PREDICTION_ID); 131 143 INSTANCE1_SC_SIGNAL(_Ifetch_unit,out_DECOD_VAL ,_param->_nb_instruction); … … 134 146 //INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_CONTEXT_ID ); 135 147 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_ADDRESS ); 136 if (_param->_have_port_inst ruction_ptr)148 if (_param->_have_port_inst_ifetch_ptr) 137 149 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_INST_IFETCH_PTR ); 138 150 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_BRANCH_STATE ); 139 if (_param->_have_port_ branch_update_prediction_id)151 if (_param->_have_port_depth) 140 152 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_BRANCH_UPDATE_PREDICTION_ID ); 141 153 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_EXCEPTION ); … … 143 155 INSTANCE_SC_SIGNAL (_Ifetch_unit,out_EVENT_ACK ); 144 156 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_ADDRESS ); 157 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_ADDRESS_NEXT ); 158 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_ADDRESS_NEXT_VAL ); 159 INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_IS_DS_TAKE ); 145 160 146 161 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 178 193 Tcontrol_t nn_val = false; 179 194 180 Tgeneral_data_t c_addr = 0x100 ;181 Tgeneral_data_t n_addr = 0x100 ;182 Tgeneral_data_t nn_addr = 0x100 ;195 Tgeneral_data_t c_addr = 0x100>>2; 196 Tgeneral_data_t n_addr = 0x100>>2; 197 Tgeneral_data_t nn_addr = 0x100>>2; 183 198 184 199 Tcontrol_t c_enable [_param->_nb_instruction]; … … 218 233 TEST(Tcontrol_t,out_DECOD_VAL [i]->read(), 0); 219 234 220 LABEL("Send Reset");221 do222 {223 in_EVENT_VAL ->write(1);224 in_EVENT_ADDRESS->write(n_addr);225 SC_START(1);226 } while (out_EVENT_ACK->read() == false);227 in_EVENT_VAL ->write(0);235 // LABEL("Send Reset"); 236 // do 237 // { 238 // in_EVENT_VAL ->write(1); 239 // in_EVENT_ADDRESS->write(n_addr); 240 // SC_START(1); 241 // } while (out_EVENT_ACK->read() == false); 242 // in_EVENT_VAL ->write(0); 228 243 229 244 n_val = 1; … … 270 285 271 286 // EVENT 272 in_EVENT_VAL ->write((rand()%100)<percent_transaction_event ); 273 in_EVENT_ADDRESS->write(0x100); 287 in_EVENT_VAL ->write((rand()%100)<percent_transaction_event ); 288 in_EVENT_ADDRESS ->write(0x77); 289 in_EVENT_ADDRESS_NEXT ->write(0x171); 290 Tcontrol_t is_ds_take = rand(); 291 in_EVENT_ADDRESS_NEXT_VAL->write(is_ds_take); 292 in_EVENT_IS_DS_TAKE ->write(is_ds_take); 274 293 275 294 // ICACHE_REQ … … 305 324 LABEL("ICACHE_REQ : Transaction accepted"); 306 325 307 Tpacket_t packet = (_param->_have_port_ queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0;326 Tpacket_t packet = (_param->_have_port_ifetch_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0; 308 327 Taddress_t address = out_ICACHE_REQ_ADDRESS->read(); 309 328 … … 344 363 if (find) 345 364 { 346 if (_param->_have_port_inst ruction_ptr)365 if (_param->_have_port_inst_ifetch_ptr) 347 366 TEST(Tinst_ifetch_ptr_t, out_DECOD_INST_IFETCH_PTR ->read(), 0); 348 367 TEST(Tbranch_state_t , out_DECOD_BRANCH_STATE ->read(), 0); 349 if (_param->_have_port_ branch_update_prediction_id)368 if (_param->_have_port_depth) 350 369 TEST(Tprediction_ptr_t , out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(), 0); 351 370 TEST(Texception_t , out_DECOD_EXCEPTION ->read(), 0); … … 404 423 c_val = false; 405 424 n_val = true; 406 nn_val = false; 407 408 n_addr = in_EVENT_ADDRESS->read(); 409 n_is_ds_take = 0; 425 426 n_addr = in_EVENT_ADDRESS->read(); 427 n_is_ds_take = in_EVENT_IS_DS_TAKE->read(); 428 nn_val = in_EVENT_ADDRESS_NEXT_VAL->read(); 429 nn_addr = in_EVENT_ADDRESS_NEXT ->read(); 430 nn_is_ds_take = 0; 410 431 411 432 n_enable [0] = 1; … … 496 517 delete out_EVENT_ACK ; 497 518 delete in_EVENT_ADDRESS ; 519 delete in_EVENT_ADDRESS_NEXT ; 520 delete in_EVENT_ADDRESS_NEXT_VAL ; 521 delete in_EVENT_IS_DS_TAKE ; 498 522 499 523 delete param_cache; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/include/Ifetch_unit.h
r82 r88 109 109 public : SC_OUT(Tcontrol_t ) * out_EVENT_ACK ; 110 110 public : SC_IN (Tgeneral_address_t) * in_EVENT_ADDRESS ; 111 public : SC_IN (Tgeneral_address_t) * in_EVENT_ADDRESS_NEXT ; 112 public : SC_IN (Tcontrol_t ) * in_EVENT_ADDRESS_NEXT_VAL ; 113 public : SC_IN (Tcontrol_t ) * in_EVENT_IS_DS_TAKE ; 111 114 112 115 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/include/Parameters.h
r81 r88 28 28 public : uint32_t _size_queue ; 29 29 public : uint32_t _nb_instruction ; 30 31 32 33 34 35 36 37 38 30 //public : uint32_t _size_address ; 31 //public : uint32_t _size_branch_update_prediction; 32 // 33 //public : uint32_t _size_queue_ptr ; 34 //public : uint32_t _size_instruction_ptr ; 35 // 36 //public : bool _have_port_queue_ptr ; 37 //public : bool _have_port_instruction_ptr ; 38 //public : bool _have_port_branch_update_prediction_id; 39 39 40 40 public :morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::address_management::Parameters * _param_address_management; … … 46 46 uint32_t nb_instruction , 47 47 uint32_t size_branch_update_prediction, 48 uint32_t size_address ); 48 uint32_t size_address , 49 bool is_toplevel=false 50 ); 49 51 // public : Parameters (Parameters & param) ; 50 52 public : ~Parameters () ; 53 54 public : void copy (void); 51 55 52 56 public : Parameters_test msg_error (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Ifetch_unit.cpp
r81 r88 37 37 log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); 38 38 39 #if DEBUG_Ifetch_unit == true 40 log_printf(INFO,Ifetch_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); 41 42 std::cout << *param << std::endl; 43 #endif 44 39 45 log_printf(INFO,Ifetch_unit,FUNCTION,"Allocation"); 40 46 … … 46 52 47 53 #ifdef STATISTICS 48 if ( _usage & USE_STATISTICS)54 if (usage_is_set(_usage,USE_STATISTICS)) 49 55 { 50 56 log_printf(INFO,Ifetch_unit,FUNCTION,"Allocation of statistics"); … … 55 61 56 62 #ifdef VHDL 57 if ( _usage & USE_VHDL)63 if (usage_is_set(_usage,USE_VHDL)) 58 64 { 59 65 // generate the vhdl … … 65 71 66 72 #ifdef SYSTEMC 67 if ( _usage & USE_SYSTEMC)73 if (usage_is_set(_usage,USE_SYSTEMC)) 68 74 { 69 75 log_printf(INFO,Ifetch_unit,FUNCTION,"Method - transition"); … … 89 95 90 96 #ifdef STATISTICS 91 if ( _usage & USE_STATISTICS)97 if (usage_is_set(_usage,USE_STATISTICS)) 92 98 { 93 99 statistics_deallocation(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Ifetch_unit_allocation.cpp
r85 r88 57 57 // ~~~~~[ Interface "icache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 58 58 { 59 ALLOC_INTERFACE("icache_req",OUT, WEST, "Instruction cache request.");59 ALLOC_INTERFACE("icache_req",OUT, WEST, _("Instruction cache request.")); 60 60 61 61 ALLOC_VALACK_OUT(out_ICACHE_REQ_VAL ,VAL); 62 62 ALLOC_VALACK_IN ( in_ICACHE_REQ_ACK ,ACK); 63 63 //ALLOC_SIGNAL_OUT(out_ICACHE_REQ_THREAD_ID,"thread_id",Tcontext_t ,_param->_size_context_id ); 64 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_PACKET_ID,"packet_id",Tpacket_t ,_param->_size_ queue_ptr );65 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_ADDRESS ,"address" ,Ticache_instruction_t,_param->_size_ address );64 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_PACKET_ID,"packet_id",Tpacket_t ,_param->_size_ifetch_queue_ptr ); 65 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_ADDRESS ,"address" ,Ticache_instruction_t,_param->_size_instruction_address ); 66 66 ALLOC_SIGNAL_OUT(out_ICACHE_REQ_TYPE ,"type" ,Ticache_type_t ,_param->_size_icache_type); 67 67 } … … 69 69 // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 70 { 71 ALLOC_INTERFACE("icache_rsp",IN , WEST, "Instruction cache respons.");71 ALLOC_INTERFACE("icache_rsp",IN , WEST, _("Instruction cache respons.")); 72 72 73 73 ALLOC_VALACK_IN ( in_ICACHE_RSP_VAL ,VAL); 74 74 ALLOC_VALACK_OUT (out_ICACHE_RSP_ACK ,ACK); 75 75 //ALLOC_SIGNAL_IN ( in_ICACHE_RSP_THREAD_ID ,"thread_id" ,Tcontext_t ,_param->_size_context_id ); 76 ALLOC_SIGNAL_IN ( in_ICACHE_RSP_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_ queue_ptr );76 ALLOC_SIGNAL_IN ( in_ICACHE_RSP_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_ifetch_queue_ptr ); 77 77 ALLOC_SIGNAL_IN ( in_ICACHE_RSP_ERROR ,"error" ,Ticache_error_t ,_param->_size_icache_error); 78 78 } 79 79 { 80 ALLOC1_INTERFACE("icache_rsp",IN , WEST, "Instruction cache respons.",_param->_nb_instruction);80 ALLOC1_INTERFACE("icache_rsp",IN , WEST, _("Instruction cache respons."),_param->_nb_instruction); 81 81 82 82 ALLOC1_SIGNAL_IN ( in_ICACHE_RSP_INSTRUCTION,"instruction",Ticache_instruction_t,_param->_size_instruction ); … … 85 85 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 86 { 87 ALLOC_INTERFACE("predict",OUT, NORTH, "Acces Instruction cache respons.");87 ALLOC_INTERFACE("predict",OUT, NORTH, _("Predict the next pc.")); 88 88 89 89 ALLOC_VALACK_OUT (out_PREDICT_VAL ,VAL); 90 90 ALLOC_VALACK_IN ( in_PREDICT_ACK ,ACK); 91 ALLOC_SIGNAL_OUT (out_PREDICT_PC_PREVIOUS ,"pc_previous" ,Tgeneral_address_t,_param->_size_ address);92 ALLOC_SIGNAL_OUT (out_PREDICT_PC_CURRENT ,"pc_current" ,Tgeneral_address_t,_param->_size_ address);91 ALLOC_SIGNAL_OUT (out_PREDICT_PC_PREVIOUS ,"pc_previous" ,Tgeneral_address_t,_param->_size_instruction_address); 92 ALLOC_SIGNAL_OUT (out_PREDICT_PC_CURRENT ,"pc_current" ,Tgeneral_address_t,_param->_size_instruction_address); 93 93 ALLOC_SIGNAL_OUT (out_PREDICT_PC_CURRENT_IS_DS_TAKE ,"pc_current_is_ds_take" ,Tcontrol_t ,1); 94 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT ,"pc_next" ,Tgeneral_address_t,_param->_size_ address);94 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT ,"pc_next" ,Tgeneral_address_t,_param->_size_instruction_address); 95 95 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT_IS_DS_TAKE ,"pc_next_is_ds_take" ,Tcontrol_t ,1); 96 ALLOC_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst ruction_ptr);96 ALLOC_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr); 97 97 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); 98 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);99 } 100 { 101 ALLOC1_INTERFACE("predict",IN , NORTH, "Acces Instruction cache respons.",_param->_nb_instruction);98 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); 99 } 100 { 101 ALLOC1_INTERFACE("predict",IN , NORTH, _("Predict the next pc."),_param->_nb_instruction); 102 102 103 103 ALLOC1_SIGNAL_IN ( in_PREDICT_INSTRUCTION_ENABLE ,"instruction_enable" ,Tcontrol_t ,1); … … 106 106 // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 107 { 108 ALLOC_INTERFACE("decod",OUT , EAST, "Send bundle to the decod unit.");108 ALLOC_INTERFACE("decod",OUT , EAST, _("Send bundle to the decod unit.")); 109 109 110 110 //ALLOC_SIGNAL_OUT (out_DECOD_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id); 111 ALLOC_SIGNAL_OUT (out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_ address);112 ALLOC_SIGNAL_OUT (out_DECOD_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst ruction_ptr);111 ALLOC_SIGNAL_OUT (out_DECOD_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address); 112 ALLOC_SIGNAL_OUT (out_DECOD_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr); 113 113 ALLOC_SIGNAL_OUT (out_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); 114 ALLOC_SIGNAL_OUT (out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_ branch_update_prediction);114 ALLOC_SIGNAL_OUT (out_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); 115 115 ALLOC_SIGNAL_OUT (out_DECOD_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_ifetch); 116 116 } 117 117 { 118 ALLOC1_INTERFACE("decod",OUT , EAST, "Send bundle to the decod unit.",_param->_nb_instruction);118 ALLOC1_INTERFACE("decod",OUT , EAST, _("Send bundle to the decod unit."),_param->_nb_instruction); 119 119 120 120 ALLOC1_VALACK_OUT(out_DECOD_VAL ,VAL); … … 125 125 // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 126 126 { 127 ALLOC_INTERFACE("event",IN , NORTH, "Event interface."); 128 129 ALLOC_VALACK_IN ( in_EVENT_VAL ,VAL); 130 ALLOC_VALACK_OUT(out_EVENT_ACK ,ACK); 131 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS,"address",Tgeneral_address_t,_param->_size_address); 127 ALLOC_INTERFACE("event",IN , NORTH, _("Event interface.")); 128 129 ALLOC_VALACK_IN ( in_EVENT_VAL ,VAL); 130 ALLOC_VALACK_OUT(out_EVENT_ACK ,ACK); 131 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address); 132 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t,_param->_size_instruction_address); 133 ALLOC_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT_VAL ,"address_next_val",Tcontrol_t,1); 134 ALLOC_SIGNAL_IN ( in_EVENT_IS_DS_TAKE ,"is_ds_take" ,Tcontrol_t,1); 132 135 } 133 136 … … 137 140 { 138 141 name = _name+"_address_management"; 139 std::cout << "Create : " << name << std::endl;142 log_printf(Ifetch_unit,Core,FUNCTION,_("Create : %s"),name.c_str()); 140 143 141 144 _component_address_management = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::address_management::Address_management … … 156 159 { 157 160 name = _name+"_ifetch_queue"; 158 std::cout << "Create : " << name << std::endl;161 log_printf(Ifetch_unit,Core,FUNCTION,_("Create : %s"),name.c_str()); 159 162 160 163 _component_ifetch_queue = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue … … 175 178 { 176 179 name = _name+"_ifetch_unit_glue"; 177 std::cout << "Create : " << name << std::endl;180 log_printf(Ifetch_unit,Core,FUNCTION,_("Create : %s"),name.c_str()); 178 181 179 182 _component_ifetch_unit_glue = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_unit_glue::Ifetch_unit_Glue … … 200 203 { 201 204 src = _name+"_address_management"; 202 std::cout << "Instance : " << src << std::endl;205 log_printf(INFO,Core,FUNCTION,_("Instance : %s"),src.c_str()); 203 206 204 207 { … … 225 228 } 226 229 227 if (_param->_have_port_inst ruction_ptr)230 if (_param->_have_port_inst_ifetch_ptr) 228 231 COMPONENT_MAP(_component,src ,"out_ADDRESS_INST_IFETCH_PTR" , 229 232 dest, "in_ADDRESS_INST_IFETCH_PTR" ); 230 233 COMPONENT_MAP(_component,src ,"out_ADDRESS_BRANCH_STATE" , 231 234 dest, "in_ADDRESS_BRANCH_STATE" ); 232 if (_param->_have_port_ branch_update_prediction_id)235 if (_param->_have_port_depth) 233 236 COMPONENT_MAP(_component,src ,"out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID", 234 237 dest, "in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID"); … … 281 284 PORT_MAP(_component,src , "in_PREDICT_PC_NEXT_IS_DS_TAKE" 282 285 ,dest, "in_PREDICT_PC_NEXT_IS_DS_TAKE" ); 283 if (_param->_have_port_inst ruction_ptr)286 if (_param->_have_port_inst_ifetch_ptr) 284 287 PORT_MAP(_component,src , "in_PREDICT_INST_IFETCH_PTR" 285 288 ,dest, "in_PREDICT_INST_IFETCH_PTR" ); 286 289 PORT_MAP(_component,src , "in_PREDICT_BRANCH_STATE" 287 290 ,dest, "in_PREDICT_BRANCH_STATE" ); 288 if (_param->_have_port_ branch_update_prediction_id)291 if (_param->_have_port_depth) 289 292 PORT_MAP(_component,src , "in_PREDICT_BRANCH_UPDATE_PREDICTION_ID" 290 293 ,dest, "in_PREDICT_BRANCH_UPDATE_PREDICTION_ID"); … … 306 309 307 310 dest = _name; 308 PORT_MAP(_component,src , "in_EVENT_ADDRESS",dest, "in_EVENT_ADDRESS"); 311 PORT_MAP(_component,src , "in_EVENT_ADDRESS" ,dest , "in_EVENT_ADDRESS" ); 312 PORT_MAP(_component,src , "in_EVENT_ADDRESS_NEXT" ,dest , "in_EVENT_ADDRESS_NEXT" ); 313 PORT_MAP(_component,src , "in_EVENT_ADDRESS_NEXT_VAL",dest , "in_EVENT_ADDRESS_NEXT_VAL" ); 314 PORT_MAP(_component,src , "in_EVENT_IS_DS_TAKE" ,dest , "in_EVENT_IS_DS_TAKE" ); 309 315 } 310 316 } … … 315 321 { 316 322 src = _name+"_ifetch_queue"; 317 std::cout << "Instance : " << src << std::endl;323 log_printf(INFO,Core,FUNCTION,_("Instance : %s"),src.c_str()); 318 324 319 325 { … … 335 341 #endif 336 342 337 if (_param->_have_port_ queue_ptr)343 if (_param->_have_port_ifetch_queue_ptr) 338 344 PORT_MAP(_component,src ,"out_ADDRESS_IFETCH_QUEUE_ID" , 339 345 dest,"out_ICACHE_REQ_PACKET_ID" ); … … 386 392 387 393 PORT_MAP(_component,src ,"out_DECOD_ADDRESS" ,dest,"out_DECOD_ADDRESS" ); 388 if (_param->_have_port_inst ruction_ptr)394 if (_param->_have_port_inst_ifetch_ptr) 389 395 PORT_MAP(_component,src ,"out_DECOD_INST_IFETCH_PTR" ,dest,"out_DECOD_INST_IFETCH_PTR" ); 390 396 PORT_MAP(_component,src ,"out_DECOD_BRANCH_STATE" ,dest,"out_DECOD_BRANCH_STATE" ); 391 if (_param->_have_port_ branch_update_prediction_id)397 if (_param->_have_port_depth) 392 398 PORT_MAP(_component,src ,"out_DECOD_BRANCH_UPDATE_PREDICTION_ID",dest,"out_DECOD_BRANCH_UPDATE_PREDICTION_ID"); 393 399 PORT_MAP(_component,src ,"out_DECOD_EXCEPTION" ,dest,"out_DECOD_EXCEPTION" ); … … 404 410 PORT_MAP(_component,src , "in_ICACHE_RSP_VAL" ,dest, "in_ICACHE_RSP_VAL" ); 405 411 PORT_MAP(_component,src ,"out_ICACHE_RSP_ACK" ,dest,"out_ICACHE_RSP_ACK" ); 406 if (_param->_have_port_ queue_ptr)412 if (_param->_have_port_ifetch_queue_ptr) 407 413 PORT_MAP(_component,src , "in_ICACHE_RSP_PACKET_ID",dest, "in_ICACHE_RSP_PACKET_ID"); 408 414 PORT_MAP(_component,src , "in_ICACHE_RSP_ERROR" ,dest, "in_ICACHE_RSP_ERROR" ); … … 437 443 { 438 444 src = _name+"_ifetch_unit_glue"; 439 std::cout << "Instance : " << src << std::endl;445 log_printf(INFO,Core,FUNCTION,_("Instance : %s"),src.c_str()); 440 446 441 447 { … … 490 496 491 497 // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 492 if (DEBUG_Ifetch_unit == true) 493 _component->test_map(); 494 495 #ifdef POSITION 496 _component->generate_file(); 498 #if DEBUG_Ifetch_unit == true 499 _component->test_map(); 500 #endif 501 502 #ifdef POSITION 503 if (usage_is_set(_usage,USE_POSITION)) 504 _component->generate_file(); 497 505 #endif 498 506 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Ifetch_unit_deallocation.cpp
r81 r88 22 22 log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); 23 23 24 if ( _usage & USE_SYSTEMC)24 if (usage_is_set(_usage,USE_SYSTEMC)) 25 25 { 26 26 delete in_CLOCK ; … … 30 30 delete in_ICACHE_REQ_ACK ; 31 31 //delete out_ICACHE_REQ_THREAD_ID ; 32 if (_param->_have_port_ queue_ptr)32 if (_param->_have_port_ifetch_queue_ptr) 33 33 delete out_ICACHE_REQ_PACKET_ID ; 34 34 delete out_ICACHE_REQ_ADDRESS ; … … 38 38 delete out_ICACHE_RSP_ACK ; 39 39 //delete in_ICACHE_RSP_THREAD_ID ; 40 if (_param->_have_port_ queue_ptr)40 if (_param->_have_port_ifetch_queue_ptr) 41 41 delete in_ICACHE_RSP_PACKET_ID ; 42 42 delete [] in_ICACHE_RSP_INSTRUCTION ; … … 51 51 delete in_PREDICT_PC_NEXT_IS_DS_TAKE ; 52 52 delete [] in_PREDICT_INSTRUCTION_ENABLE ; 53 if (_param->_have_port_inst ruction_ptr)53 if (_param->_have_port_inst_ifetch_ptr) 54 54 delete in_PREDICT_INST_IFETCH_PTR ; 55 55 delete in_PREDICT_BRANCH_STATE ; 56 if (_param->_have_port_ branch_update_prediction_id)56 if (_param->_have_port_depth) 57 57 delete in_PREDICT_BRANCH_UPDATE_PREDICTION_ID ; 58 58 … … 62 62 //delete out_DECOD_CONTEXT_ID ; 63 63 delete out_DECOD_ADDRESS ; 64 if (_param->_have_port_inst ruction_ptr)64 if (_param->_have_port_inst_ifetch_ptr) 65 65 delete out_DECOD_INST_IFETCH_PTR ; 66 66 delete out_DECOD_BRANCH_STATE ; 67 if (_param->_have_port_ branch_update_prediction_id)67 if (_param->_have_port_depth) 68 68 delete out_DECOD_BRANCH_UPDATE_PREDICTION_ID ; 69 69 delete out_DECOD_EXCEPTION ; … … 72 72 delete out_EVENT_ACK ; 73 73 delete in_EVENT_ADDRESS ; 74 delete in_EVENT_ADDRESS_NEXT ; 75 delete in_EVENT_ADDRESS_NEXT_VAL ; 76 delete in_EVENT_IS_DS_TAKE ; 74 77 } 75 78 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Ifetch_unit_end_cycle.cpp
r81 r88 24 24 25 25 #ifdef STATISTICS 26 _stat->end_cycle(); 26 if (usage_is_set(_usage,USE_STATISTICS)) 27 _stat->end_cycle(); 27 28 #endif 28 29 … … 30 31 // Evaluation before read the ouput signal 31 32 // sc_start(0); 32 _interfaces->testbench(); 33 if (usage_is_set(_usage,USE_VHDL_TESTBENCH)) 34 _interfaces->testbench(); 33 35 #endif 34 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Parameters.cpp
r85 r88 21 21 uint32_t nb_instruction , 22 22 uint32_t size_branch_update_prediction, 23 uint32_t size_address ) 23 uint32_t size_address , 24 bool is_toplevel 25 ) 24 26 { 25 27 log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); … … 27 29 _size_queue = size_queue ; 28 30 _nb_instruction = nb_instruction ; 29 _size_branch_update_prediction = size_branch_update_prediction; 30 _size_address = size_address ; 31 32 _size_queue_ptr = log2(size_queue); 33 _size_instruction_ptr = log2(nb_instruction); 34 35 _have_port_queue_ptr = _size_queue_ptr > 0; 36 _have_port_instruction_ptr = _size_instruction_ptr > 0; 37 _have_port_branch_update_prediction_id = size_branch_update_prediction > 0; 31 // _size_branch_update_prediction = size_branch_update_prediction; 32 // _size_address = size_address ; 38 33 39 34 test(); … … 50 45 _param_ifetch_unit_glue = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_unit_glue:: Parameters 51 46 (size_address); 52 47 48 if (is_toplevel) 49 { 50 _size_instruction_address = size_address; 51 _size_ifetch_queue_ptr = log2(size_queue); 52 _size_inst_ifetch_ptr = log2(nb_instruction); 53 _size_depth = size_branch_update_prediction; 54 55 _have_port_ifetch_queue_ptr = _size_ifetch_queue_ptr > 0; 56 _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; 57 _have_port_depth = _size_depth > 0; 58 59 copy (); 60 } 61 53 62 log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); 54 63 }; … … 74 83 }; 75 84 85 #undef FUNCTION 86 #define FUNCTION "Ifetch_unit::copy" 87 void Parameters::copy (void) 88 { 89 log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); 90 91 COPY(_param_address_management); 92 COPY(_param_ifetch_queue ); 93 COPY(_param_ifetch_unit_glue ); 94 95 log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); 96 }; 97 76 98 }; // end namespace ifetch_unit 77 99 }; // end namespace front_end -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Parameters_print.cpp
r81 r88 23 23 log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); 24 24 25 XML xml ("ifetch_unit");25 // XML xml ("ifetch_unit"); 26 26 27 xml.balise_open("ifetch_unit"); 28 xml.singleton_begin("size_queue "); xml.attribut("value",toString(_size_queue )); xml.singleton_end(); 29 xml.singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction )); xml.singleton_end(); 30 xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end(); 31 xml.singleton_begin("size_address "); xml.attribut("value",toString(_size_address )); xml.singleton_end(); 32 xml.balise_close(); 27 // xml.balise_open("ifetch_unit"); 28 // xml.singleton_begin("size_queue "); xml.attribut("value",toString(_size_queue )); xml.singleton_end(); 29 // xml.singleton_begin("nb_instruction "); xml.attribut("value",toString(_nb_instruction )); xml.singleton_end(); 30 // // xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end(); 31 // // xml.singleton_begin("size_address "); xml.attribut("value",toString(_size_address )); xml.singleton_end(); 32 // xml.balise_close(); 33 34 // return xml.get_body(depth); 35 36 std::string str = ""; 33 37 34 38 log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); 39 40 return str; 35 41 36 return xml.get_body(depth);37 42 }; 38 43
Note: See TracChangeset
for help on using the changeset viewer.