1 | /* |
---|
2 | * $Id: main.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue/SelfTest/include/test.h" |
---|
9 | |
---|
10 | #define NB_PARAMS 7 |
---|
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_gpr_write (uint32_t)\n")); |
---|
17 | err (_(" * nb_spr_write (uint32_t)\n")); |
---|
18 | err (_(" * size_ooo_engine_id (uint32_t)\n")); |
---|
19 | err (_(" * size_general_register (uint32_t)\n")); |
---|
20 | err (_(" * size_special_register (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 != static_cast<int>(2+NB_PARAMS)) |
---|
34 | usage (argc, argv); |
---|
35 | |
---|
36 | uint32_t x = 1; |
---|
37 | |
---|
38 | string name = argv[x++]; |
---|
39 | uint32_t _nb_gpr_write = fromString<uint32_t>(argv[x++]); |
---|
40 | uint32_t _nb_spr_write = fromString<uint32_t>(argv[x++]); |
---|
41 | uint32_t _size_ooo_engine_id = fromString<uint32_t>(argv[x++]); |
---|
42 | uint32_t _size_general_register = fromString<uint32_t>(argv[x++]); |
---|
43 | uint32_t _size_special_register = fromString<uint32_t>(argv[x++]); |
---|
44 | uint32_t _size_general_data = fromString<uint32_t>(argv[x++]); |
---|
45 | uint32_t _size_special_data = fromString<uint32_t>(argv[x++]); |
---|
46 | |
---|
47 | int _return = EXIT_SUCCESS; |
---|
48 | try |
---|
49 | { |
---|
50 | morpheo::behavioural::core::multi_execute_loop::execute_loop::execute_loop_glue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::execute_loop_glue::Parameters |
---|
51 | ( |
---|
52 | _nb_gpr_write , |
---|
53 | _nb_spr_write , |
---|
54 | _size_ooo_engine_id , |
---|
55 | _size_general_register , |
---|
56 | _size_special_register , |
---|
57 | _size_general_data , |
---|
58 | _size_special_data , |
---|
59 | true // is_toplevel |
---|
60 | ); |
---|
61 | |
---|
62 | msg(_("%s"),param->print(0).c_str()); |
---|
63 | |
---|
64 | test (name,param); |
---|
65 | } |
---|
66 | catch (morpheo::ErrorMorpheo & error) |
---|
67 | { |
---|
68 | msg (_("<%s> :\n%s"),name.c_str(), error.what ()); |
---|
69 | _return = EXIT_FAILURE; |
---|
70 | } |
---|
71 | |
---|
72 | try |
---|
73 | { |
---|
74 | if (_return == EXIT_SUCCESS) |
---|
75 | TEST_OK("Execute_loop_Glue : no error"); |
---|
76 | else |
---|
77 | TEST_KO("Execute_loop_Glue : a lot of error"); |
---|
78 | } |
---|
79 | catch (morpheo::ErrorMorpheo & error) |
---|
80 | { |
---|
81 | // msg (_("<%s> :\n%s"),name.c_str(), error.what ()); |
---|
82 | _return = EXIT_FAILURE; |
---|
83 | } |
---|
84 | |
---|
85 | return (_return); |
---|
86 | } |
---|