[78] | 1 | /* |
---|
| 2 | * $Id: main.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/SelfTest/include/test.h" |
---|
| 9 | |
---|
| 10 | #define NB_PARAMS 8 |
---|
| 11 | |
---|
| 12 | void usage (int argc, char * argv[]) |
---|
| 13 | { |
---|
| 14 | err (_("<Usage> %s name_instance list_params.\n"),argv[0]); |
---|
| 15 | err (_("list_params is :\n")); |
---|
| 16 | err (_(" * nb_front_end (uint32_t)\n")); |
---|
| 17 | err (_(" * nb_context [nb_front_end] (uint32_t)\n")); |
---|
| 18 | err (_(" * nb_general_register (uint32_t)\n")); |
---|
| 19 | err (_(" * nb_special_register (uint32_t)\n")); |
---|
| 20 | err (_(" * nb_inst_insert (uint32_t)\n")); |
---|
| 21 | err (_(" * nb_inst_retire (uint32_t)\n")); |
---|
| 22 | err (_(" * nb_reg_free (uint32_t)\n")); |
---|
| 23 | err (_(" * nb_bank (uint32_t)\n")); |
---|
| 24 | err (_(" * size_counter (uint32_t)\n")); |
---|
| 25 | |
---|
| 26 | exit (1); |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | #ifndef SYSTEMC |
---|
| 30 | int main (int argc, char * argv[]) |
---|
| 31 | #else |
---|
| 32 | int sc_main (int argc, char * argv[]) |
---|
| 33 | #endif |
---|
| 34 | { |
---|
| 35 | if (argc < static_cast<int>(2+NB_PARAMS)) |
---|
| 36 | usage (argc, argv); |
---|
| 37 | |
---|
| 38 | uint32_t x = 1; |
---|
| 39 | |
---|
| 40 | const string name = argv[x++]; |
---|
| 41 | |
---|
| 42 | uint32_t _nb_front_end = atoi(argv[x++]); |
---|
| 43 | |
---|
| 44 | if (argc != static_cast<int>(2+NB_PARAMS+_nb_front_end)) |
---|
| 45 | usage (argc, argv); |
---|
| 46 | |
---|
| 47 | uint32_t * _nb_context = new uint32_t [_nb_front_end]; |
---|
| 48 | for (uint32_t i=0; i<_nb_front_end; i++) |
---|
| 49 | _nb_context [i] = atoi(argv[x++]); |
---|
| 50 | |
---|
| 51 | uint32_t _nb_general_register = atoi(argv[x++]); |
---|
| 52 | uint32_t _nb_special_register = atoi(argv[x++]); |
---|
| 53 | uint32_t _nb_inst_insert = atoi(argv[x++]); |
---|
| 54 | uint32_t _nb_inst_retire = atoi(argv[x++]); |
---|
| 55 | uint32_t _nb_reg_free = atoi(argv[x++]); |
---|
| 56 | uint32_t _nb_bank = atoi(argv[x++]); |
---|
| 57 | uint32_t _size_counter = atoi(argv[x++]); |
---|
| 58 | |
---|
| 59 | try |
---|
| 60 | { |
---|
| 61 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::stat_list_unit::Parameters * param = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::stat_list_unit::Parameters |
---|
| 62 | (_nb_front_end , |
---|
| 63 | _nb_context , |
---|
| 64 | _nb_general_register , |
---|
| 65 | _nb_special_register , |
---|
| 66 | _nb_inst_insert , |
---|
| 67 | _nb_inst_retire , |
---|
| 68 | _nb_reg_free , |
---|
| 69 | _nb_bank , |
---|
| 70 | _size_counter ); |
---|
| 71 | |
---|
| 72 | msg(_("%s"),param->print(1).c_str()); |
---|
| 73 | |
---|
| 74 | test (name,param); |
---|
| 75 | } |
---|
| 76 | catch (morpheo::ErrorMorpheo & error) |
---|
| 77 | { |
---|
| 78 | msg (_("<%s> : %s.\n"),name.c_str(), error.what ()); |
---|
| 79 | exit (EXIT_FAILURE); |
---|
| 80 | } |
---|
| 81 | catch (...) |
---|
| 82 | { |
---|
| 83 | err (_("<%s> : This test must generate a error.\n"),name.c_str()); |
---|
| 84 | exit (EXIT_FAILURE); |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | delete [] _nb_context; |
---|
| 88 | |
---|
| 89 | return (EXIT_SUCCESS); |
---|
| 90 | } |
---|
| 91 | |
---|