Changeset 138 for trunk/Platforms/Test/src
- Timestamp:
- May 12, 2010, 7:34:01 PM (14 years ago)
- Location:
- trunk/Platforms/Test/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platforms/Test/src/sc_main.cpp
r115 r138 20 20 ) 21 21 { 22 cerr << "<Usage> " << argv[0] << endl 23 << "In input stream : " << endl 24 << " * filename_simulator (string )" << endl 25 << " * filename_generator (string )" << endl 26 << " * filename_instance (string )" << endl 27 << " * filename_software (string )" << endl 28 << " * nb_cache_dedicated (uint32_t)" << endl 29 << " * nb_cache_shared (uint32_t)" << endl 30 << " * size cache L1 (byte) (uint32_t)" << endl 31 << " * ratio cache (uint32_t)" << endl; 22 msgError("<Usage> %s\n",argv[0]); 23 msgError("In input stream :\n"); 24 msgError(" * filename_simulator (string )\n"); 25 msgError(" * filename_generator (string )\n"); 26 msgError(" * filename_instance (string )\n"); 27 msgError(" * filename_software (string )\n"); 28 msgError(" * nb_cache_dedicated (uint32_t)\n"); 29 msgError(" * nb_cache_shared (uint32_t)\n"); 30 msgError(" * size cache L1 (byte) (uint32_t)\n"); 31 msgError(" * ratio cache (uint32_t)\n"); 32 32 33 exit (EXIT_FAILURE); 33 34 }; … … 41 42 #endif 42 43 { 43 cout << "<sc_main> Begin" << endl;44 msgInformation("<sc_main> Begin\n"); 44 45 45 46 #ifdef MTI_SYSTEMC … … 52 53 #endif 53 54 55 msgInformation(" "); 54 56 for (int32_t i=0; i<argc; ++i) 55 cout << argv[i] << " ";56 cout << endl;57 msg("%s ",argv[i]); 58 msg("\n"); 57 59 58 60 //============================================================================== … … 72 74 uint32_t cache_size = fromString<uint32_t>(argv[x++]); 73 75 uint32_t cache_ratio = fromString<uint32_t>(argv[x++]); 74 75 // string filename_simulator;76 // string filename_generator;77 // string filename_instance ;78 // string filename_software ;79 // uint32_t nb_cache_dedicated;80 // uint32_t nb_cache_shared ;81 // uint32_t cache_size ;82 // uint32_t cache_ratio ;83 84 // cout << "get filename_simulator ? " << endl;85 // cin >> filename_simulator ;86 87 // cout << "get filename_generator ? " << endl;88 // cin >> filename_generator ;89 90 // cout << "get filename_instance ? " << endl;91 // cin >> filename_instance ;92 93 // cout << "get filename_software ? " << endl;94 // cin >> filename_software ;95 96 // cout << "get nb_cache_dedicated ? " << endl;97 // cin >> nb_cache_dedicated ;98 99 // cout << "get nb_cache_shared ? " << endl;100 // cin >> nb_cache_shared ;101 102 // cout << "get size cache L1 (byte) ? " << endl;103 // cin >> cache_size ;104 105 // cout << "get ratio cache ? " << endl;106 // cin >> cache_ratio ;107 76 108 77 morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void) = NULL; … … 118 87 get_custom_information); 119 88 120 cout << " * return : " << _return << endl;121 cout << "<sc_main> End" << endl;89 msgInformation(" * return : %d\n",_return); 90 msgInformation("<sc_main> End\n"); 122 91 123 92 #ifndef MTI_SYSTEMC -
trunk/Platforms/Test/src/test.cpp
r132 r138 44 44 if (setlocale (LC_ALL, "") == NULL) 45 45 { 46 cerr << "Error setlocale." << endl;46 msgError("Error setlocale.\n"); 47 47 exit (EXIT_FAILURE); 48 48 } 49 49 50 50 // 2) Morpheo Construction 51 Morpheo * morpheo = new Morpheo 52 ("morpheo", 53 filename_simulator, 54 filename_generator, 55 filename_instance , 56 get_custom_information 57 ); 51 Morpheo * morpheo; 52 try 53 { 54 morpheo = new Morpheo 55 ("morpheo", 56 filename_simulator, 57 filename_generator, 58 filename_instance , 59 get_custom_information 60 ); 61 } 62 catch (morpheo::ErrorMorpheo & error) 63 { 64 std::cerr << error.what() << std::endl; 65 66 msgError("%s\n",STR_KO); 67 68 return EXIT_FAILURE; 69 } 58 70 59 71 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 91 103 daccess_size_address [i] = morpheo->_size_dcache_address; 92 104 daccess_size_data [i] = morpheo->_size_dcache_data; 93 105 94 106 buffer_irsp_size [i] = 8; 95 107 buffer_drsp_size [i] = 8; … … 129 141 if (cache_size<(cache_size_line*cache_size_word)) 130 142 { 131 cerr << "cache is too small" << endl;143 msgError("cache is too small\n"); 132 144 exit(EXIT_FAILURE); 133 145 } … … 308 320 // cout << param_environment->print(0) << endl; 309 321 310 segtable->print();311 312 322 Environment * environment = new Environment ("environment",param_environment); 313 323 314 324 const char * sections_text [] = {".text",NULL}; 315 325 const char * sections_data [] = {".data",".rodata",".bss",".sdata",".sbss", NULL}; 316 317 if (environment->init("text" , filename_software.c_str(), sections_text) == false) exit (EXIT_FAILURE); 318 if (environment->init("data" , filename_software.c_str(), sections_data) == false) exit (EXIT_FAILURE); 326 327 if (environment->init("text", filename_software.c_str(), sections_text) == false) exit (EXIT_FAILURE); 328 if (environment->init("data", filename_software.c_str(), sections_data) == false) exit (EXIT_FAILURE); 329 330 // segtable->print(); 319 331 320 332 //============================================================================== … … 322 334 //============================================================================== 323 335 #ifdef SYSTEMCASS_SPECIFIC 324 sc_clock * CLOCK = new sc_clock (" clock", 1.0, 0.5);336 sc_clock * CLOCK = new sc_clock ("CLOCK__________________", 1.0, 0.5); 325 337 #else 326 338 sc_time period (TIME_PERIOD, TIME_UNIT); 327 sc_clock * CLOCK = new sc_clock (" clock", period);339 sc_clock * CLOCK = new sc_clock ("CLOCK__________________", period); 328 340 #endif 329 sc_signal<Tcontrol_t> * NRESET = new sc_signal<Tcontrol_t> ("NRESET ");341 sc_signal<Tcontrol_t> * NRESET = new sc_signal<Tcontrol_t> ("NRESET_________________"); 330 342 331 343 sc_signal<Tcontrol_t > ** ICACHE_REQ_VAL ; … … 360 372 sc_signal<Tcontrol_t > ** INTERRUPT_ENABLE ; 361 373 362 ALLOC1_SC_SIGNAL(ICACHE_REQ_VAL ,"ICACHE_REQ_VAL 363 ALLOC1_SC_SIGNAL(ICACHE_REQ_ACK ,"ICACHE_REQ_ACK 364 ALLOC1_SC_SIGNAL(ICACHE_REQ_THREAD_ID ,"ICACHE_REQ_THREAD_ID 365 ALLOC1_SC_SIGNAL(ICACHE_REQ_PACKET_ID ,"ICACHE_REQ_PACKET_ID 366 ALLOC1_SC_SIGNAL(ICACHE_REQ_ADDRESS ,"ICACHE_REQ_ADDRESS 367 ALLOC1_SC_SIGNAL(ICACHE_REQ_TYPE ,"ICACHE_REQ_TYPE 368 369 ALLOC1_SC_SIGNAL(ICACHE_RSP_VAL ,"ICACHE_RSP_VAL 370 ALLOC1_SC_SIGNAL(ICACHE_RSP_ACK ,"ICACHE_RSP_ACK 371 ALLOC1_SC_SIGNAL(ICACHE_RSP_THREAD_ID ,"ICACHE_RSP_THREAD_ID 372 ALLOC1_SC_SIGNAL(ICACHE_RSP_PACKET_ID ,"ICACHE_RSP_PACKET_ID 373 ALLOC2_SC_SIGNAL(ICACHE_RSP_INSTRUCTION ,"ICACHE_RSP_INSTRUCTION ",Ticache_instruction_t,morpheo->_nb_icache_port,morpheo->_icache_nb_instruction[it1]);374 ALLOC1_SC_SIGNAL(ICACHE_RSP_ERROR ,"ICACHE_RSP_ERROR 375 376 ALLOC1_SC_SIGNAL(DCACHE_REQ_VAL ,"DCACHE_REQ_VAL 377 ALLOC1_SC_SIGNAL(DCACHE_REQ_ACK ,"DCACHE_REQ_ACK 378 ALLOC1_SC_SIGNAL(DCACHE_REQ_THREAD_ID ,"DCACHE_REQ_THREAD_ID 379 ALLOC1_SC_SIGNAL(DCACHE_REQ_PACKET_ID ,"DCACHE_REQ_PACKET_ID 380 ALLOC1_SC_SIGNAL(DCACHE_REQ_ADDRESS ,"DCACHE_REQ_ADDRESS 381 ALLOC1_SC_SIGNAL(DCACHE_REQ_WDATA ,"DCACHE_REQ_WDATA 382 ALLOC1_SC_SIGNAL(DCACHE_REQ_TYPE ,"DCACHE_REQ_TYPE 383 384 ALLOC1_SC_SIGNAL(DCACHE_RSP_VAL ,"DCACHE_RSP_VAL 385 ALLOC1_SC_SIGNAL(DCACHE_RSP_ACK ,"DCACHE_RSP_ACK 386 ALLOC1_SC_SIGNAL(DCACHE_RSP_THREAD_ID ,"DCACHE_RSP_THREAD_ID 387 ALLOC1_SC_SIGNAL(DCACHE_RSP_PACKET_ID ,"DCACHE_RSP_PACKET_ID 388 ALLOC1_SC_SIGNAL(DCACHE_RSP_RDATA ,"DCACHE_RSP_RDATA 389 ALLOC1_SC_SIGNAL(DCACHE_RSP_ERROR ,"DCACHE_RSP_ERROR 390 391 ALLOC1_SC_SIGNAL(INTERRUPT_ENABLE ,"INTERRUPT_ENABLE 374 ALLOC1_SC_SIGNAL(ICACHE_REQ_VAL ,"ICACHE_REQ_VAL_________",Tcontrol_t ,morpheo->_nb_icache_port); 375 ALLOC1_SC_SIGNAL(ICACHE_REQ_ACK ,"ICACHE_REQ_ACK_________",Tcontrol_t ,morpheo->_nb_icache_port); 376 ALLOC1_SC_SIGNAL(ICACHE_REQ_THREAD_ID ,"ICACHE_REQ_THREAD_ID___",Ticache_context_t ,morpheo->_nb_icache_port); 377 ALLOC1_SC_SIGNAL(ICACHE_REQ_PACKET_ID ,"ICACHE_REQ_PACKET_ID___",Ticache_packet_t ,morpheo->_nb_icache_port); 378 ALLOC1_SC_SIGNAL(ICACHE_REQ_ADDRESS ,"ICACHE_REQ_ADDRESS_____",Ticache_address_t ,morpheo->_nb_icache_port); 379 ALLOC1_SC_SIGNAL(ICACHE_REQ_TYPE ,"ICACHE_REQ_TYPE________",Ticache_type_t ,morpheo->_nb_icache_port); 380 381 ALLOC1_SC_SIGNAL(ICACHE_RSP_VAL ,"ICACHE_RSP_VAL_________",Tcontrol_t ,morpheo->_nb_icache_port); 382 ALLOC1_SC_SIGNAL(ICACHE_RSP_ACK ,"ICACHE_RSP_ACK_________",Tcontrol_t ,morpheo->_nb_icache_port); 383 ALLOC1_SC_SIGNAL(ICACHE_RSP_THREAD_ID ,"ICACHE_RSP_THREAD_ID___",Ticache_context_t ,morpheo->_nb_icache_port); 384 ALLOC1_SC_SIGNAL(ICACHE_RSP_PACKET_ID ,"ICACHE_RSP_PACKET_ID___",Ticache_packet_t ,morpheo->_nb_icache_port); 385 ALLOC2_SC_SIGNAL(ICACHE_RSP_INSTRUCTION ,"ICACHE_RSP_INSTRUCTION_",Ticache_instruction_t,morpheo->_nb_icache_port,morpheo->_icache_nb_instruction[it1]); 386 ALLOC1_SC_SIGNAL(ICACHE_RSP_ERROR ,"ICACHE_RSP_ERROR_______",Ticache_error_t ,morpheo->_nb_icache_port); 387 388 ALLOC1_SC_SIGNAL(DCACHE_REQ_VAL ,"DCACHE_REQ_VAL_________",Tcontrol_t ,morpheo->_nb_dcache_port); 389 ALLOC1_SC_SIGNAL(DCACHE_REQ_ACK ,"DCACHE_REQ_ACK_________",Tcontrol_t ,morpheo->_nb_dcache_port); 390 ALLOC1_SC_SIGNAL(DCACHE_REQ_THREAD_ID ,"DCACHE_REQ_THREAD_ID___",Tdcache_context_t ,morpheo->_nb_dcache_port); 391 ALLOC1_SC_SIGNAL(DCACHE_REQ_PACKET_ID ,"DCACHE_REQ_PACKET_ID___",Tdcache_packet_t ,morpheo->_nb_dcache_port); 392 ALLOC1_SC_SIGNAL(DCACHE_REQ_ADDRESS ,"DCACHE_REQ_ADDRESS_____",Tdcache_address_t ,morpheo->_nb_dcache_port); 393 ALLOC1_SC_SIGNAL(DCACHE_REQ_WDATA ,"DCACHE_REQ_WDATA_______",Tdcache_data_t ,morpheo->_nb_dcache_port); 394 ALLOC1_SC_SIGNAL(DCACHE_REQ_TYPE ,"DCACHE_REQ_TYPE________",Tdcache_type_t ,morpheo->_nb_dcache_port); 395 396 ALLOC1_SC_SIGNAL(DCACHE_RSP_VAL ,"DCACHE_RSP_VAL_________",Tcontrol_t ,morpheo->_nb_dcache_port); 397 ALLOC1_SC_SIGNAL(DCACHE_RSP_ACK ,"DCACHE_RSP_ACK_________",Tcontrol_t ,morpheo->_nb_dcache_port); 398 ALLOC1_SC_SIGNAL(DCACHE_RSP_THREAD_ID ,"DCACHE_RSP_THREAD_ID___",Tdcache_context_t ,morpheo->_nb_dcache_port); 399 ALLOC1_SC_SIGNAL(DCACHE_RSP_PACKET_ID ,"DCACHE_RSP_PACKET_ID___",Tdcache_packet_t ,morpheo->_nb_dcache_port); 400 ALLOC1_SC_SIGNAL(DCACHE_RSP_RDATA ,"DCACHE_RSP_RDATA_______",Tdcache_data_t ,morpheo->_nb_dcache_port); 401 ALLOC1_SC_SIGNAL(DCACHE_RSP_ERROR ,"DCACHE_RSP_ERROR_______",Tdcache_error_t ,morpheo->_nb_dcache_port); 402 403 ALLOC1_SC_SIGNAL(INTERRUPT_ENABLE ,"INTERRUPT_ENABLE_______",Tcontrol_t ,morpheo->_nb_thread); 392 404 393 405 //============================================================================== … … 492 504 // initialisation 493 505 494 cerr << "<test> Simulation Init" << endl;506 msgInformation("<test> Simulation Init\n"); 495 507 496 508 sc_time t (0, TIME_UNIT); 497 509 sc_start(t); 498 510 499 cerr << "<test> Simulation Start" << endl;511 msgInformation("<test> Simulation Start\n"); 500 512 501 513 bool morpheo_error = false; … … 523 535 catch (morpheo::ErrorMorpheo & error) 524 536 { 525 std::cerr << error.what() << std::endl 526 << STR_KO << std::endl; 537 std::cerr << error.what() << std::endl; 538 539 msgError("%s\n",STR_KO); 527 540 528 541 morpheo_error = true; … … 647 660 if (not morpheo_end and not environment_end) 648 661 { 649 cerr << "<test> Simulation End : Unknow" << endl;662 msgError("<test> Simulation End : Unknow\n"); 650 663 } 651 664 else … … 653 666 if (morpheo_end) 654 667 { 655 cout << "<test> Simulation End : MORPHEO" << endl;668 msgInformation("<test> Simulation End : MORPHEO\n"); 656 669 test_ok = true; 657 670 } 658 671 if (environment_end) 659 672 { 660 cout << "<test> Simulation End : ENVIRONMENT" << endl;673 msgInformation("<test> Simulation End : ENVIRONMENT\n"); 661 674 test_ok = true; 662 675 } … … 666 679 if (test_ok) 667 680 { 668 cout << STR_OK << endl;681 msgInformation("%s\n",STR_OK); 669 682 return EXIT_SUCCESS; 670 683 } 671 684 else 672 685 { 673 cout << STR_KO << endl;686 msgInformation("%s\n",STR_KO); 674 687 return EXIT_FAILURE; 675 688 }
Note: See TracChangeset
for help on using the changeset viewer.