Changeset 113 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/src/main.cpp
- Timestamp:
- Apr 14, 2009, 8:39:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/src/main.cpp
r88 r113 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/include/t est.h"8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 7 11 12 void usage (int argc, char * argv[]) 10 #ifndef MTI_SYSTEMC 11 # ifndef SYSTEMC 12 int main (int argc, char * argv[]) 13 # else 14 int sc_main (int argc, char * argv[]) 15 # endif 13 16 { 14 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 err (_("list_params is :\n")); 16 err (_(" * size_queue (uint32_t)\n")); 17 err (_(" * nb_context (uint32_t)\n")); 18 err (_(" * nb_front_end (uint32_t)\n")); 19 err (_(" * nb_ooo_engine (uint32_t)\n")); 20 err (_(" * nb_packet (uint32_t)\n")); 21 err (_(" * size_general_data (uint32_t)\n")); 22 err (_(" * size_special_data (uint32_t)\n")); 23 24 exit (1); 25 } 26 27 #ifndef SYSTEMC 28 int main (int argc, char * argv[]) 29 #else 30 int sc_main (int argc, char * argv[]) 31 #endif 32 { 33 if (argc != 2+NB_PARAMS) 34 usage (argc, argv); 35 36 uint32_t x = 1; 37 38 const string name = argv[x++]; 39 const uint32_t size_queue = atoi(argv[x++]); 40 const uint32_t nb_context = atoi(argv[x++]); 41 const uint32_t nb_front_end = atoi(argv[x++]); 42 const uint32_t nb_ooo_engine = atoi(argv[x++]); 43 const uint32_t nb_packet = atoi(argv[x++]); 44 const uint32_t size_general_data = atoi(argv[x++]); 45 const uint32_t size_special_data = atoi(argv[x++]); 17 int _return = EXIT_SUCCESS; 46 18 47 19 try 48 20 { 49 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters 50 (size_queue , 51 nb_context , 52 nb_front_end , 53 nb_ooo_engine , 54 nb_packet , 55 size_general_data , 56 size_special_data , 57 true // is_toplevel 58 ); 59 60 msg(_("%s"),param->print(1).c_str()); 61 62 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 63 26 } 64 27 catch (morpheo::ErrorMorpheo & error) 65 28 { 66 msg (_("<%s> : %s.\n"),name.c_str(),error.what ());67 exit (EXIT_FAILURE);29 msgError(_("%s\n"),error.what ()); 30 _return = EXIT_FAILURE; 68 31 } 69 catch (...) 32 33 try 70 34 { 71 err (_("<%s> : This test must generate a error.\n"),name.c_str()); 72 exit (EXIT_FAILURE); 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Execute_queue : no error"); 37 else 38 TEST_KO("Execute_queue : a lot of error"); 39 } 40 catch (morpheo::ErrorMorpheo & error) 41 { 42 // msgError(_("<%s> :\n%s"),name.c_str(), error.what ()); 43 _return = EXIT_FAILURE; 73 44 } 74 45 75 return (EXIT_SUCCESS);46 return _return; 76 47 } 77 48 #endif
Note: See TracChangeset
for help on using the changeset viewer.