Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp
r87 r88 22 22 23 23 #ifdef STATISTICS 24 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5, 50);24 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,0); 25 25 #endif 26 27 Tusage_t _usage = USE_ALL; 28 29 // _usage = usage_unset(_usage,USE_SYSTEMC ); 30 // _usage = usage_unset(_usage,USE_VHDL ); 31 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); 32 // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); 33 // _usage = usage_unset(_usage,USE_POSITION ); 34 // _usage = usage_unset(_usage,USE_STATISTICS ); 35 // _usage = usage_unset(_usage,USE_INFORMATION ); 26 36 27 37 Decod * _Decod = new Decod … … 31 41 #endif 32 42 _param, 33 USE_ALL);43 _usage); 34 44 35 45 #ifdef SYSTEMC … … 42 52 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 43 53 44 ALLOC2_SC_SIGNAL( in_IFETCH_VAL ," in_IFETCH_VAL ",Tcontrol_t ,_param->_nb_context,_param->_nb_inst_fetch[ alloc_signal_it1]);45 ALLOC2_SC_SIGNAL(out_IFETCH_ACK ,"out_IFETCH_ACK ",Tcontrol_t ,_param->_nb_context,_param->_nb_inst_fetch[ alloc_signal_it1]);46 ALLOC2_SC_SIGNAL( in_IFETCH_INSTRUCTION ," in_IFETCH_INSTRUCTION ",Tinstruction_t ,_param->_nb_context,_param->_nb_inst_fetch[ alloc_signal_it1]);54 ALLOC2_SC_SIGNAL( in_IFETCH_VAL ," in_IFETCH_VAL ",Tcontrol_t ,_param->_nb_context,_param->_nb_inst_fetch[it1]); 55 ALLOC2_SC_SIGNAL(out_IFETCH_ACK ,"out_IFETCH_ACK ",Tcontrol_t ,_param->_nb_context,_param->_nb_inst_fetch[it1]); 56 ALLOC2_SC_SIGNAL( in_IFETCH_INSTRUCTION ," in_IFETCH_INSTRUCTION ",Tinstruction_t ,_param->_nb_context,_param->_nb_inst_fetch[it1]); 47 57 ALLOC1_SC_SIGNAL( in_IFETCH_CONTEXT_ID ," in_IFETCH_CONTEXT_ID ",Tcontext_t ,_param->_nb_context); 48 58 ALLOC1_SC_SIGNAL( in_IFETCH_ADDRESS ," in_IFETCH_ADDRESS ",Tgeneral_address_t ,_param->_nb_context); … … 51 61 ALLOC1_SC_SIGNAL( in_IFETCH_BRANCH_STATE ," in_IFETCH_BRANCH_STATE ",Tbranch_state_t ,_param->_nb_context); 52 62 ALLOC1_SC_SIGNAL( in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ," in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ",Tprediction_ptr_t ,_param->_nb_context); 63 ALLOC1_SC_SIGNAL( in_IFETCH_EXCEPTION ," in_IFETCH_EXCEPTION ",Texception_t ,_param->_nb_context); 64 53 65 ALLOC1_SC_SIGNAL(out_DECOD_VAL ,"out_DECOD_VAL ",Tcontrol_t ,_param->_nb_inst_decod); 54 66 ALLOC1_SC_SIGNAL( in_DECOD_ACK ," in_DECOD_ACK ",Tcontrol_t ,_param->_nb_inst_decod); … … 57 69 ALLOC1_SC_SIGNAL(out_DECOD_TYPE ,"out_DECOD_TYPE ",Ttype_t ,_param->_nb_inst_decod); 58 70 ALLOC1_SC_SIGNAL(out_DECOD_OPERATION ,"out_DECOD_OPERATION ",Toperation_t ,_param->_nb_inst_decod); 71 ALLOC1_SC_SIGNAL(out_DECOD_NO_EXECUTE ,"out_DECOD_NO_EXECUTE ",Tcontrol_t ,_param->_nb_inst_decod); 59 72 ALLOC1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT ,"out_DECOD_IS_DELAY_SLOT ",Tcontrol_t ,_param->_nb_inst_decod); 60 73 ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS ,"out_DECOD_ADDRESS ",Tgeneral_data_t ,_param->_nb_inst_decod); … … 72 85 ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RE ,"out_DECOD_NUM_REG_RE ",Tspecial_address_t ,_param->_nb_inst_decod); 73 86 ALLOC1_SC_SIGNAL(out_DECOD_EXCEPTION_USE ,"out_DECOD_EXCEPTION_USE ",Texception_t ,_param->_nb_inst_decod); 87 ALLOC1_SC_SIGNAL(out_DECOD_EXCEPTION ,"out_DECOD_EXCEPTION ",Texception_t ,_param->_nb_inst_decod); 74 88 ALLOC1_SC_SIGNAL(out_PREDICT_VAL ,"out_PREDICT_VAL ",Tcontrol_t ,_param->_nb_inst_decod); 75 89 ALLOC1_SC_SIGNAL( in_PREDICT_ACK ," in_PREDICT_ACK ",Tcontrol_t ,_param->_nb_inst_decod); … … 89 103 ALLOC_SC_SIGNAL ( in_CONTEXT_EVENT_ACK ," in_CONTEXT_EVENT_ACK ",Tcontrol_t ); 90 104 ALLOC_SC_SIGNAL (out_CONTEXT_EVENT_CONTEXT_ID ,"out_CONTEXT_EVENT_CONTEXT_ID ",Tcontext_t ); 105 ALLOC_SC_SIGNAL (out_CONTEXT_EVENT_DEPTH ,"out_CONTEXT_EVENT_DEPTH ",Tdepth_t ); 91 106 ALLOC_SC_SIGNAL (out_CONTEXT_EVENT_TYPE ,"out_CONTEXT_EVENT_TYPE ",Tevent_type_t ); 92 107 ALLOC_SC_SIGNAL (out_CONTEXT_EVENT_IS_DELAY_SLOT ,"out_CONTEXT_EVENT_IS_DELAY_SLOT ",Tcontrol_t ); … … 103 118 (*(_Decod->in_NRESET)) (*(in_NRESET)); 104 119 105 INSTANCE2_SC_SIGNAL(_Decod, in_IFETCH_VAL ,_param->_nb_context,_param->_nb_inst_fetch[ alloc_signal_it1]);106 INSTANCE2_SC_SIGNAL(_Decod,out_IFETCH_ACK ,_param->_nb_context,_param->_nb_inst_fetch[ alloc_signal_it1]);107 INSTANCE2_SC_SIGNAL(_Decod, in_IFETCH_INSTRUCTION ,_param->_nb_context,_param->_nb_inst_fetch[ alloc_signal_it1]);120 INSTANCE2_SC_SIGNAL(_Decod, in_IFETCH_VAL ,_param->_nb_context,_param->_nb_inst_fetch[it1]); 121 INSTANCE2_SC_SIGNAL(_Decod,out_IFETCH_ACK ,_param->_nb_context,_param->_nb_inst_fetch[it1]); 122 INSTANCE2_SC_SIGNAL(_Decod, in_IFETCH_INSTRUCTION ,_param->_nb_context,_param->_nb_inst_fetch[it1]); 108 123 if (_param->_have_port_context_id) 109 124 INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_CONTEXT_ID ,_param->_nb_context); 110 125 INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_ADDRESS ,_param->_nb_context); 111 126 // INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_ADDRESS_NEXT ,_param->_nb_context); 112 if (_param->_have_port_inst_ifetch_ptr)113 INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_INST_IFETCH_PTR ,_param->_nb_context);114 127 INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_BRANCH_STATE ,_param->_nb_context); 115 if (_param->_have_port_branch_update_prediction_id) 116 INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,_param->_nb_context); 128 INSTANCE1_SC_SIGNAL(_Decod, in_IFETCH_EXCEPTION ,_param->_nb_context); 129 130 for (uint32_t i=0; i<_param->_nb_context; i++) 131 { 132 if (_param->_have_port_inst_ifetch_ptr) 133 INSTANCE_SC_SIGNAL(_Decod, in_IFETCH_INST_IFETCH_PTR [i]); 134 // if (_param->_have_port_branch_update_prediction_id) 135 if (_param->_have_port_depth) 136 INSTANCE_SC_SIGNAL(_Decod, in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i]); 137 } 138 117 139 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_VAL ,_param->_nb_inst_decod); 118 140 INSTANCE1_SC_SIGNAL(_Decod, in_DECOD_ACK ,_param->_nb_inst_decod); … … 123 145 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_TYPE ,_param->_nb_inst_decod); 124 146 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_OPERATION ,_param->_nb_inst_decod); 147 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_NO_EXECUTE ,_param->_nb_inst_decod); 125 148 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_IS_DELAY_SLOT ,_param->_nb_inst_decod); 126 149 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_ADDRESS ,_param->_nb_inst_decod); … … 138 161 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_NUM_REG_RE ,_param->_nb_inst_decod); 139 162 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_EXCEPTION_USE ,_param->_nb_inst_decod); 163 INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_EXCEPTION ,_param->_nb_inst_decod); 140 164 INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_VAL ,_param->_nb_inst_decod); 141 165 INSTANCE1_SC_SIGNAL(_Decod, in_PREDICT_ACK ,_param->_nb_inst_decod); … … 144 168 INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_MATCH_INST_IFETCH_PTR ,_param->_nb_inst_decod); 145 169 INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_BRANCH_STATE ,_param->_nb_inst_decod); 146 if (_param->_have_port_branch_update_prediction_id) 170 // if (_param->_have_port_branch_update_prediction_id) 171 if (_param->_have_port_depth) 147 172 INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_inst_decod); 148 173 INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_BRANCH_CONDITION ,_param->_nb_inst_decod); … … 153 178 // INSTANCE1_SC_SIGNAL(_Decod, in_PREDICT_CAN_CONTINUE ,_param->_nb_inst_decod); 154 179 INSTANCE1_SC_SIGNAL(_Decod, in_CONTEXT_DECOD_ENABLE ,_param->_nb_context); 155 if (_param->_have_port_depth) 156 INSTANCE1_SC_SIGNAL(_Decod, in_CONTEXT_DEPTH ,_param->_nb_context); 180 for (uint32_t i=0; i<_param->_nb_context; i++) 181 if (_param->_have_port_depth) 182 INSTANCE_SC_SIGNAL(_Decod, in_CONTEXT_DEPTH [i]); 157 183 INSTANCE_SC_SIGNAL (_Decod,out_CONTEXT_EVENT_VAL ); 158 184 INSTANCE_SC_SIGNAL (_Decod, in_CONTEXT_EVENT_ACK ); 159 185 if (_param->_have_port_context_id) 160 186 INSTANCE_SC_SIGNAL (_Decod,out_CONTEXT_EVENT_CONTEXT_ID ); 187 if (_param->_have_port_depth) 188 INSTANCE_SC_SIGNAL (_Decod,out_CONTEXT_EVENT_DEPTH ); 161 189 INSTANCE_SC_SIGNAL (_Decod,out_CONTEXT_EVENT_TYPE ); 162 190 INSTANCE_SC_SIGNAL (_Decod,out_CONTEXT_EVENT_IS_DELAY_SLOT ); … … 236 264 if (_param->_have_port_inst_ifetch_ptr) 237 265 in_IFETCH_INST_IFETCH_PTR [i]->write(0); 266 in_IFETCH_EXCEPTION [i]->write(EXCEPTION_IFETCH_NONE); 238 267 239 268 // Alignement … … 336 365 TEST(Tcontrol_t , out_PREDICT_MATCH_INST_IFETCH_PTR [i]->read(),((request [context].front()._address)%_param->_nb_inst_fetch[context]) == 0); 337 366 TEST(Tbranch_state_t , out_PREDICT_BRANCH_STATE [i]->read(), request [context].front()._branch_state ); 338 if (_param->_have_port_branch_update_prediction_id) 367 // if (_param->_have_port_branch_update_prediction_id) 368 if (_param->_have_port_depth) 339 369 TEST(Tprediction_ptr_t , out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i]->read(), request [context].front()._branch_update_prediction_id); 340 370 TEST(Tbranch_condition_t, out_PREDICT_BRANCH_CONDITION [i]->read(), request [context].front()._branch_condition ); … … 358 388 if (_param->_have_port_context_id) 359 389 TEST(Tcontext_t ,out_CONTEXT_EVENT_CONTEXT_ID ->read(), context); 390 if (_param->_have_port_depth ) 391 TEST(Tcontext_t ,out_CONTEXT_EVENT_DEPTH ->read(), request [context].front()._depth ); 360 392 TEST(Tevent_type_t ,out_CONTEXT_EVENT_TYPE ->read(), request [context].front()._context_event_type); 361 393 TEST(Tcontrol_t ,out_CONTEXT_EVENT_IS_DELAY_SLOT->read(), request [context].front()._is_delay_slot); … … 403 435 delete [] in_IFETCH_BRANCH_STATE ; 404 436 delete [] in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ; 437 delete [] in_IFETCH_EXCEPTION ; 405 438 406 439 delete [] out_DECOD_VAL ; … … 410 443 delete [] out_DECOD_TYPE ; 411 444 delete [] out_DECOD_OPERATION ; 445 delete [] out_DECOD_NO_EXECUTE ; 412 446 delete [] out_DECOD_IS_DELAY_SLOT ; 413 447 delete [] out_DECOD_ADDRESS ; … … 425 459 delete [] out_DECOD_NUM_REG_RE ; 426 460 delete [] out_DECOD_EXCEPTION_USE ; 461 delete [] out_DECOD_EXCEPTION ; 427 462 428 463 delete [] out_PREDICT_VAL ; … … 445 480 delete in_CONTEXT_EVENT_ACK ; 446 481 delete out_CONTEXT_EVENT_CONTEXT_ID ; 482 delete out_CONTEXT_EVENT_DEPTH ; 447 483 delete out_CONTEXT_EVENT_TYPE ; 448 484 delete out_CONTEXT_EVENT_IS_DELAY_SLOT ;
Note: See TracChangeset
for help on using the changeset viewer.