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/Prediction_unit/Direction/Direction_Glue/SelfTest/include/test.h" |
---|
9 | |
---|
10 | #define NB_PARAMS 5 |
---|
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 (_(" * predictor_scheme (Tpredictor_t)\n")); |
---|
17 | err (_(" * nb_inst_predict (uint32_t )\n")); |
---|
18 | err (_(" * nb_inst_update (uint32_t )\n")); |
---|
19 | err (_(" * size_address (uint32_t )\n")); |
---|
20 | err (_(" * size_history (uint32_t )\n")); |
---|
21 | |
---|
22 | exit (1); |
---|
23 | } |
---|
24 | |
---|
25 | #ifndef SYSTEMC |
---|
26 | int main (int argc, char * argv[]) |
---|
27 | #else |
---|
28 | int sc_main (int argc, char * argv[]) |
---|
29 | #endif |
---|
30 | { |
---|
31 | if (argc != static_cast<int>(2+NB_PARAMS)) |
---|
32 | usage (argc, argv); |
---|
33 | |
---|
34 | uint32_t x = 1; |
---|
35 | |
---|
36 | string name = argv[x++]; |
---|
37 | Tpredictor_t _predictor_scheme = fromString<Tpredictor_t>(argv[x++]); |
---|
38 | uint32_t _nb_inst_predict = fromString<uint32_t >(argv[x++]); |
---|
39 | uint32_t _nb_inst_update = fromString<uint32_t >(argv[x++]); |
---|
40 | uint32_t _size_address = fromString<uint32_t >(argv[x++]); |
---|
41 | uint32_t _size_history = fromString<uint32_t >(argv[x++]); |
---|
42 | |
---|
43 | int _return = EXIT_SUCCESS; |
---|
44 | try |
---|
45 | { |
---|
46 | morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Parameters |
---|
47 | (_predictor_scheme, |
---|
48 | _nb_inst_predict , |
---|
49 | _nb_inst_update , |
---|
50 | _size_address , |
---|
51 | _size_history , |
---|
52 | true // is_toplevel |
---|
53 | ); |
---|
54 | |
---|
55 | msg(_("%s"),param->print(1).c_str()); |
---|
56 | |
---|
57 | test (name,param); |
---|
58 | } |
---|
59 | catch (morpheo::ErrorMorpheo & error) |
---|
60 | { |
---|
61 | msg (_("<%s> :\n%s"),name.c_str(), error.what ()); |
---|
62 | _return = EXIT_FAILURE; |
---|
63 | } |
---|
64 | catch (...) |
---|
65 | { |
---|
66 | err (_("<%s> : This test must generate a error.\n"),name.c_str()); |
---|
67 | _return = EXIT_FAILURE; |
---|
68 | } |
---|
69 | |
---|
70 | return (_return); |
---|
71 | } |
---|