[78] | 1 | /* |
---|
| 2 | * $Id: main.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/SelfTest/include/test.h" |
---|
| 9 | |
---|
| 10 | #define NB_PARAMS 4 |
---|
| 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 (_(" * size_queue (uint32_t)\n")); |
---|
| 17 | err (_(" * nb_instruction (uint32_t)\n")); |
---|
| 18 | err (_(" * size_branch_update_prediction (uint32_t)\n")); |
---|
| 19 | err (_(" * size_general_data (uint32_t)\n")); |
---|
| 20 | |
---|
| 21 | exit (1); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | #ifndef SYSTEMC |
---|
| 25 | int main (int argc, char * argv[]) |
---|
| 26 | #else |
---|
| 27 | int sc_main (int argc, char * argv[]) |
---|
| 28 | #endif |
---|
| 29 | { |
---|
| 30 | if (argc != static_cast<int>(2+NB_PARAMS)) |
---|
| 31 | usage (argc, argv); |
---|
| 32 | |
---|
| 33 | uint32_t x = 1; |
---|
| 34 | |
---|
| 35 | string name = argv[x++]; |
---|
| 36 | |
---|
| 37 | uint32_t _size_queue = fromString<uint32_t>(argv[x++]); |
---|
| 38 | uint32_t _nb_instruction = fromString<uint32_t>(argv[x++]); |
---|
| 39 | uint32_t _size_branch_update_prediction = fromString<uint32_t>(argv[x++]); |
---|
| 40 | uint32_t _size_general_data = fromString<uint32_t>(argv[x++]); |
---|
| 41 | |
---|
| 42 | int _return = EXIT_SUCCESS; |
---|
| 43 | try |
---|
| 44 | { |
---|
| 45 | morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::Parameters |
---|
| 46 | (_size_queue , |
---|
| 47 | _nb_instruction , |
---|
| 48 | _size_branch_update_prediction , |
---|
[88] | 49 | _size_general_data , |
---|
| 50 | true // is_toplevel |
---|
| 51 | ); |
---|
[78] | 52 | |
---|
| 53 | msg(_("%s"),param->print(1).c_str()); |
---|
| 54 | |
---|
| 55 | test (name,param); |
---|
| 56 | } |
---|
| 57 | catch (morpheo::ErrorMorpheo & error) |
---|
| 58 | { |
---|
| 59 | msg (_("<%s> :\n%s"),name.c_str(), error.what ()); |
---|
| 60 | _return = EXIT_FAILURE; |
---|
| 61 | } |
---|
| 62 | catch (...) |
---|
| 63 | { |
---|
| 64 | err (_("<%s> : This test must generate a error.\n"),name.c_str()); |
---|
| 65 | _return = EXIT_FAILURE; |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | return (_return); |
---|
| 69 | } |
---|