Changeset 124 for trunk/Platforms/Test/src/test.cpp
- Timestamp:
- Jun 17, 2009, 2:11:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platforms/Test/src/test.cpp
r123 r124 493 493 cerr << "<test> Simulation Start" << endl; 494 494 495 Time * _time_global = new Time(); 496 497 for (uint32_t i=0; i<morpheo->_nb_thread; ++i) 498 INTERRUPT_ENABLE[i]->write(0); 499 500 NRESET->write(0); 501 SC_START(5); 502 NRESET->write(1); 503 504 // Infinite loop 505 do 506 { 507 // Time * _time_local = new Time(); 508 SC_START(100000); 509 // delete _time_local; 510 } while (not morpheo ->simulation_end() and // morpheo condition stop 511 not environment->simulation_end()); // test ok 512 delete _time_global; 495 bool morpheo_error = false; 496 try 497 { 498 Time * _time_global = new Time(); 499 500 for (uint32_t i=0; i<morpheo->_nb_thread; ++i) 501 INTERRUPT_ENABLE[i]->write(0); 502 503 NRESET->write(0); 504 SC_START(5); 505 NRESET->write(1); 506 507 // Infinite loop 508 do 509 { 510 // Time * _time_local = new Time(); 511 SC_START(100000); 512 // delete _time_local; 513 } while (not morpheo ->simulation_end() and // morpheo condition stop 514 not environment->simulation_end()); // test ok 515 delete _time_global; 516 } 517 catch (morpheo::ErrorMorpheo & error) 518 { 519 std::cerr << error.what() << std::endl 520 << STR_KO << std::endl; 521 522 morpheo_error = true; 523 } 513 524 514 525 bool morpheo_end = morpheo->simulation_end(); … … 626 637 627 638 bool test_ok = false; 628 if (not morpheo_end and not environment_end) 629 { 630 cerr << "<test> Simulation End : Unknow" << endl; 631 } 632 else 633 { 634 if (morpheo_end) 635 cout << "<test> Simulation End : MORPHEO" << endl; 636 if (environment_end) 639 if (not morpheo_error) 640 { 641 if (not morpheo_end and not environment_end) 637 642 { 638 cout << "<test> Simulation End : ENVIRONMENT" << endl; 639 test_ok = true; 643 cerr << "<test> Simulation End : Unknow" << endl; 640 644 } 641 } 642 645 else 646 { 647 if (morpheo_end) 648 { 649 cout << "<test> Simulation End : MORPHEO" << endl; 650 test_ok = true; 651 } 652 if (environment_end) 653 { 654 cout << "<test> Simulation End : ENVIRONMENT" << endl; 655 test_ok = true; 656 } 657 } 658 } 659 643 660 if (test_ok) 644 661 {
Note: See TracChangeset
for help on using the changeset viewer.