Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_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/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;
Note: See TracChangeset
for help on using the changeset viewer.