Changeset 113 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_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/Write_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/Write_queue/SelfTest/include/t est.h"8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/SelfTest/include/top.h" 9 9 10 #define NB_PARAMS 10 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 (_(" * nb_general_register (uint32_t)\n")); 23 err (_(" * size_special_data (uint32_t)\n")); 24 err (_(" * nb_special_register (uint32_t)\n")); 25 err (_(" * nb_bypass_write (uint32_t)\n")); 26 27 exit (1); 28 } 29 30 #ifndef SYSTEMC 31 int main (int argc, char * argv[]) 32 #else 33 int sc_main (int argc, char * argv[]) 34 #endif 35 { 36 if (argc != 2+NB_PARAMS) 37 usage (argc, argv); 38 39 uint32_t x = 1; 40 41 const string name = argv[x++]; 42 const uint32_t size_queue = atoi(argv[x++]); 43 const uint32_t nb_context = atoi(argv[x++]); 44 const uint32_t nb_front_end = atoi(argv[x++]); 45 const uint32_t nb_ooo_engine = atoi(argv[x++]); 46 const uint32_t nb_packet = atoi(argv[x++]); 47 const uint32_t size_general_data = atoi(argv[x++]); 48 const uint32_t nb_general_register = atoi(argv[x++]); 49 const uint32_t size_special_data = atoi(argv[x++]); 50 const uint32_t nb_special_register = atoi(argv[x++]); 51 const uint32_t nb_bypass_write = atoi(argv[x++]); 17 int _return = EXIT_SUCCESS; 52 18 53 19 try 54 20 { 55 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters 56 (size_queue , 57 nb_context , 58 nb_front_end , 59 nb_ooo_engine , 60 nb_packet , 61 size_general_data , 62 nb_general_register, 63 size_special_data , 64 nb_special_register, 65 nb_bypass_write , 66 true // is_toplevel 67 ); 68 69 msg(_("%s"),param->print(1).c_str()); 70 71 test (name,param); 21 top * my_top = new top ("my_top",argc,argv); 22 23 my_top->test(); 24 25 delete my_top; 72 26 } 73 27 catch (morpheo::ErrorMorpheo & error) 74 28 { 75 msg (_("<%s> : %s.\n"),name.c_str(),error.what ());76 exit (EXIT_FAILURE);29 msg(_("%s"),error.what ()); 30 _return = EXIT_FAILURE; 77 31 } 78 catch (...) 32 33 try 79 34 { 80 err (_("<%s> : This test must generate a error.\n"),name.c_str()); 81 exit (EXIT_FAILURE); 35 if (_return == EXIT_SUCCESS) 36 TEST_OK("Write_queue : no error"); 37 else 38 TEST_KO("Write_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; 82 44 } 83 45 84 return (EXIT_SUCCESS);46 return _return; 85 47 } 86 48 #endif
Note: See TracChangeset
for help on using the changeset viewer.