Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/src/test.cpp
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/src/test.cpp
r87 r88 53 53 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 54 54 55 ALLOC2_SC_SIGNAL( in_IFETCH_VAL ," in_IFETCH_VAL ",Tcontrol_t ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);56 ALLOC2_SC_SIGNAL(out_IFETCH_ACK ,"out_IFETCH_ACK ",Tcontrol_t ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);57 ALLOC2_SC_SIGNAL( in_IFETCH_INSTRUCTION ," in_IFETCH_INSTRUCTION ",Tinstruction_t ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);55 ALLOC2_SC_SIGNAL( in_IFETCH_VAL ," in_IFETCH_VAL ",Tcontrol_t ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 56 ALLOC2_SC_SIGNAL(out_IFETCH_ACK ,"out_IFETCH_ACK ",Tcontrol_t ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 57 ALLOC2_SC_SIGNAL( in_IFETCH_INSTRUCTION ," in_IFETCH_INSTRUCTION ",Tinstruction_t ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 58 58 59 59 ALLOC1_SC_SIGNAL(in_IFETCH_CONTEXT_ID ,"in_IFETCH_CONTEXT_ID ",Tcontext_t ,_param->_nb_context); … … 63 63 ALLOC1_SC_SIGNAL(in_IFETCH_BRANCH_STATE ,"in_IFETCH_BRANCH_STATE ",Tbranch_state_t ,_param->_nb_context); 64 64 ALLOC1_SC_SIGNAL(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,"in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ",Tprediction_ptr_t ,_param->_nb_context); 65 ALLOC1_SC_SIGNAL(in_IFETCH_EXCEPTION ,"in_IFETCH_EXCEPTION ",Texception_t ,_param->_nb_context); 65 66 66 67 ALLOC1_SC_SIGNAL(out_DECOD_VAL ,"out_DECOD_VAL ",Tcontrol_t ,_param->_nb_inst_decod); … … 70 71 ALLOC1_SC_SIGNAL(out_DECOD_TYPE ,"out_DECOD_TYPE ",Ttype_t ,_param->_nb_inst_decod); 71 72 ALLOC1_SC_SIGNAL(out_DECOD_OPERATION ,"out_DECOD_OPERATION ",Toperation_t ,_param->_nb_inst_decod); 73 ALLOC1_SC_SIGNAL(out_DECOD_NO_EXECUTE ,"out_DECOD_NO_EXECUTE ",Tcontrol_t ,_param->_nb_inst_decod); 72 74 ALLOC1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT ,"out_DECOD_IS_DELAY_SLOT ",Tcontrol_t ,_param->_nb_inst_decod); 73 75 ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS ,"out_DECOD_ADDRESS ",Tgeneral_data_t ,_param->_nb_inst_decod); … … 85 87 ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RE ,"out_DECOD_NUM_REG_RE ",Tspecial_address_t ,_param->_nb_inst_decod); 86 88 ALLOC1_SC_SIGNAL(out_DECOD_EXCEPTION_USE ,"out_DECOD_EXCEPTION_USE ",Texception_t ,_param->_nb_inst_decod); 89 ALLOC1_SC_SIGNAL(out_DECOD_EXCEPTION ,"out_DECOD_EXCEPTION ",Texception_t ,_param->_nb_inst_decod); 87 90 88 91 ALLOC1_SC_SIGNAL(out_PREDICT_VAL ,"out_PREDICT_VAL ",Tcontrol_t ,_param->_nb_inst_decod); … … 99 102 //ALLOC1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE ," in_PREDICT_CAN_CONTINUE ",Tcontrol_t ,_param->_nb_inst_decod); 100 103 101 ALLOC1_SC_SIGNAL( in_DEPTH_ TAIL ," in_DEPTH_TAIL",Tdepth_t ,_param->_nb_context);102 ALLOC1_SC_SIGNAL( in_DEPTH_ NB_BRANCH ," in_DEPTH_NB_BRANCH",Tdepth_t ,_param->_nb_context);104 ALLOC1_SC_SIGNAL( in_DEPTH_MIN ," in_DEPTH_MIN ",Tdepth_t ,_param->_nb_context); 105 ALLOC1_SC_SIGNAL( in_DEPTH_MAX ," in_DEPTH_MAX ",Tdepth_t ,_param->_nb_context); 103 106 104 107 ALLOC1_SC_SIGNAL(out_NB_INST_DECOD_ALL ,"out_NB_INST_DECOD_ALL ",Tcounter_t ,_param->_nb_context); … … 110 113 ALLOC_SC_SIGNAL( in_CONTEXT_EVENT_ACK ," in_CONTEXT_EVENT_ACK ",Tcontrol_t ); 111 114 ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_CONTEXT_ID ,"out_CONTEXT_EVENT_CONTEXT_ID ",Tcontext_t ); 115 ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_DEPTH ,"out_CONTEXT_EVENT_DEPTH ",Tdepth_t ); 112 116 ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_TYPE ,"out_CONTEXT_EVENT_TYPE ",Tevent_type_t ); 113 117 ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_IS_DELAY_SLOT ,"out_CONTEXT_EVENT_IS_DELAY_SLOT ",Tcontrol_t ); … … 124 128 (*(_Decod_unit->in_NRESET)) (*(in_NRESET)); 125 129 126 INSTANCE2_SC_SIGNAL(_Decod_unit, in_IFETCH_VAL ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);127 INSTANCE2_SC_SIGNAL(_Decod_unit,out_IFETCH_ACK ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);128 INSTANCE2_SC_SIGNAL(_Decod_unit, in_IFETCH_INSTRUCTION ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);130 INSTANCE2_SC_SIGNAL(_Decod_unit, in_IFETCH_VAL ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 131 INSTANCE2_SC_SIGNAL(_Decod_unit,out_IFETCH_ACK ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 132 INSTANCE2_SC_SIGNAL(_Decod_unit, in_IFETCH_INSTRUCTION ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 129 133 if (_param->_have_port_context_id) 130 134 INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_CONTEXT_ID ,_param->_nb_context); 131 135 INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_ADDRESS ,_param->_nb_context); 132 136 //INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_ADDRESS_NEXT ,_param->_nb_context); 133 if (_param->_have_port_inst_ifetch_ptr) 134 INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_INST_IFETCH_PTR ,_param->_nb_context); 137 138 for (uint32_t i=0; i<_param->_nb_context; ++i) 139 { 140 if (_param->_have_port_inst_ifetch_ptr) 141 INSTANCE_SC_SIGNAL(_Decod_unit,in_IFETCH_INST_IFETCH_PTR[i]); 142 if (_param->_have_port_depth) 143 INSTANCE_SC_SIGNAL(_Decod_unit,in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i]); 144 } 145 135 146 INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_BRANCH_STATE ,_param->_nb_context); 136 if (_param->_have_port_branch_update_prediction_id) 137 INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,_param->_nb_context); 147 INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_EXCEPTION ,_param->_nb_context); 138 148 139 149 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_VAL ,_param->_nb_inst_decod); … … 145 155 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_TYPE ,_param->_nb_inst_decod); 146 156 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_OPERATION ,_param->_nb_inst_decod); 157 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NO_EXECUTE ,_param->_nb_inst_decod); 147 158 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_IS_DELAY_SLOT ,_param->_nb_inst_decod); 148 159 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_ADDRESS ,_param->_nb_inst_decod); … … 160 171 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NUM_REG_RE ,_param->_nb_inst_decod); 161 172 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_EXCEPTION_USE ,_param->_nb_inst_decod); 173 INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_EXCEPTION ,_param->_nb_inst_decod); 162 174 163 175 INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_VAL ,_param->_nb_inst_decod); … … 167 179 INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_MATCH_INST_IFETCH_PTR ,_param->_nb_inst_decod); 168 180 INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_STATE ,_param->_nb_inst_decod); 169 if (_param->_have_port_ branch_update_prediction_id)181 if (_param->_have_port_depth) 170 182 INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_inst_decod); 171 183 INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_CONDITION ,_param->_nb_inst_decod); … … 176 188 //INSTANCE1_SC_SIGNAL(_Decod_unit, in_PREDICT_CAN_CONTINUE ,_param->_nb_inst_decod); 177 189 178 if (_param->_have_port_depth) 179 { 180 INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_TAIL ,_param->_nb_context); 181 INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_NB_BRANCH ,_param->_nb_context); 182 } 190 INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_MAX ,_param->_nb_context); 183 191 184 192 INSTANCE1_SC_SIGNAL(_Decod_unit,out_NB_INST_DECOD_ALL ,_param->_nb_context); 185 193 186 194 INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DECOD_ENABLE ,_param->_nb_context); 187 if (_param->_have_port_depth) 188 INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DEPTH ,_param->_nb_context); 195 196 for (uint32_t i=0; i<_param->_nb_context; ++i) 197 if (_param->_have_port_depth) 198 { 199 INSTANCE_SC_SIGNAL(_Decod_unit, in_DEPTH_MIN [i]); 200 INSTANCE_SC_SIGNAL(_Decod_unit, in_CONTEXT_DEPTH [i]); 201 } 189 202 190 203 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_VAL ); … … 192 205 if (_param->_have_port_context_id) 193 206 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_CONTEXT_ID ); 207 if (_param->_have_port_depth) 208 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_DEPTH ); 194 209 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_TYPE ); 195 210 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_IS_DELAY_SLOT ); 196 211 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_ADDRESS ); 197 212 INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_ADDRESS_EPCR ); 198 199 213 200 214 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 247 261 delay_slot_next [i] = false; 248 262 249 in_DEPTH_ TAIL[i]->write(0);250 in_DEPTH_ NB_BRANCH[i]->write(0);263 in_DEPTH_MIN [i]->write(0); 264 in_DEPTH_MAX [i]->write(0); 251 265 in_CONTEXT_DEPTH [i]->write(0); 252 266 } … … 285 299 in_IFETCH_BRANCH_STATE [i]->write(it->_branch_state); 286 300 in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i]->write(it->_branch_update_prediction_id); 301 in_IFETCH_EXCEPTION [i]->write(it->_exception_ifetch); 287 302 288 303 if ((it->_is_delay_slot) or … … 350 365 TEST(Tcontrol_t , out_PREDICT_MATCH_INST_IFETCH_PTR [x]->read(),((entry._address)%_param->_nb_inst_fetch[i]) == 0); 351 366 TEST(Tbranch_state_t , out_PREDICT_BRANCH_STATE [x]->read(), entry._branch_state ); 352 if (_param->_have_port_ branch_update_prediction_id)367 if (_param->_have_port_depth) 353 368 TEST(Tprediction_ptr_t , out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [x]->read(), entry._branch_update_prediction_id); 354 369 TEST(Tbranch_condition_t, out_PREDICT_BRANCH_CONDITION [x]->read(), entry._branch_condition ); … … 367 382 368 383 if (_param->_have_port_context_id) 369 TEST(Tcontext_t ,out_CONTEXT_EVENT_CONTEXT_ID ->read(), i); 384 TEST(Tcontext_t ,out_CONTEXT_EVENT_CONTEXT_ID ->read(), i); 385 if (_param->_have_port_depth) 386 TEST(Tcontext_t ,out_CONTEXT_EVENT_DEPTH ->read(), entry._depth); 370 387 TEST(Tevent_type_t ,out_CONTEXT_EVENT_TYPE ->read(), entry._context_event_type); 371 388 TEST(Tcontrol_t ,out_CONTEXT_EVENT_IS_DELAY_SLOT->read(), entry._is_delay_slot); … … 396 413 TEST(Ttype_t , out_DECOD_TYPE [i]->read(), respons [context].front()._type ); 397 414 TEST(Toperation_t , out_DECOD_OPERATION [i]->read(), respons [context].front()._operation ); 415 // TEST(Tcontrol_t , out_DECOD_NO_EXECUTE [i]->read(), respons [context].front()._no_execute ); 398 416 TEST(Tcontrol_t , out_DECOD_IS_DELAY_SLOT [i]->read(), respons [context].front()._is_delay_slot); 399 417 TEST(Tgeneral_data_t , out_DECOD_ADDRESS [i]->read(), respons [context].front()._address ); … … 417 435 TEST(Tspecial_address_t, out_DECOD_NUM_REG_RE [i]->read(), respons [context].front()._num_reg_re ); 418 436 TEST(Texception_t , out_DECOD_EXCEPTION_USE [i]->read(), respons [context].front()._exception_use); 437 // TEST(Texception_t , out_DECOD_EXCEPTION [i]->read(), respons [context].front()._exception ); 419 438 420 439 respons [context].pop_front(); … … 446 465 delete in_NRESET; 447 466 448 DELETE2_SC_SIGNAL( in_IFETCH_VAL ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);449 DELETE2_SC_SIGNAL(out_IFETCH_ACK ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);450 DELETE2_SC_SIGNAL( in_IFETCH_INSTRUCTION ,_param->_nb_context, _param->_nb_inst_fetch[ alloc_signal_it1]);467 DELETE2_SC_SIGNAL( in_IFETCH_VAL ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 468 DELETE2_SC_SIGNAL(out_IFETCH_ACK ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 469 DELETE2_SC_SIGNAL( in_IFETCH_INSTRUCTION ,_param->_nb_context, _param->_nb_inst_fetch[it1]); 451 470 DELETE1_SC_SIGNAL(in_IFETCH_CONTEXT_ID ,_param->_nb_context); 452 471 DELETE1_SC_SIGNAL(in_IFETCH_ADDRESS ,_param->_nb_context); … … 455 474 DELETE1_SC_SIGNAL(in_IFETCH_BRANCH_STATE ,_param->_nb_context); 456 475 DELETE1_SC_SIGNAL(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,_param->_nb_context); 476 DELETE1_SC_SIGNAL(in_IFETCH_EXCEPTION ,_param->_nb_context); 457 477 458 478 DELETE1_SC_SIGNAL(out_DECOD_VAL ,_param->_nb_inst_decod); … … 462 482 DELETE1_SC_SIGNAL(out_DECOD_TYPE ,_param->_nb_inst_decod); 463 483 DELETE1_SC_SIGNAL(out_DECOD_OPERATION ,_param->_nb_inst_decod); 484 DELETE1_SC_SIGNAL(out_DECOD_NO_EXECUTE ,_param->_nb_inst_decod); 464 485 DELETE1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT ,_param->_nb_inst_decod); 465 486 DELETE1_SC_SIGNAL(out_DECOD_ADDRESS ,_param->_nb_inst_decod); … … 477 498 DELETE1_SC_SIGNAL(out_DECOD_NUM_REG_RE ,_param->_nb_inst_decod); 478 499 DELETE1_SC_SIGNAL(out_DECOD_EXCEPTION_USE ,_param->_nb_inst_decod); 500 DELETE1_SC_SIGNAL(out_DECOD_EXCEPTION ,_param->_nb_inst_decod); 479 501 480 502 DELETE1_SC_SIGNAL(out_PREDICT_VAL ,_param->_nb_inst_decod); … … 491 513 //DELETE1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE ,_param->_nb_inst_decod); 492 514 493 DELETE1_SC_SIGNAL( in_DEPTH_ TAIL,_param->_nb_context);494 DELETE1_SC_SIGNAL( in_DEPTH_ NB_BRANCH,_param->_nb_context);515 DELETE1_SC_SIGNAL( in_DEPTH_MIN ,_param->_nb_context); 516 DELETE1_SC_SIGNAL( in_DEPTH_MAX ,_param->_nb_context); 495 517 496 518 DELETE1_SC_SIGNAL(out_NB_INST_DECOD_ALL ,_param->_nb_context); … … 502 524 DELETE_SC_SIGNAL( in_CONTEXT_EVENT_ACK ); 503 525 DELETE_SC_SIGNAL( out_CONTEXT_EVENT_CONTEXT_ID ); 526 DELETE_SC_SIGNAL( out_CONTEXT_EVENT_DEPTH ); 504 527 DELETE_SC_SIGNAL( out_CONTEXT_EVENT_TYPE ); 505 528 DELETE_SC_SIGNAL( out_CONTEXT_EVENT_IS_DELAY_SLOT );
Note: See TracChangeset
for help on using the changeset viewer.