1 | /* |
---|
2 | * $Id: main.cpp 112 2009-03-18 22:36:26Z 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 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_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 | |
---|
25 | exit (1); |
---|
26 | } |
---|
27 | |
---|
28 | #ifndef SYSTEMC |
---|
29 | int main (int argc, char * argv[]) |
---|
30 | #else |
---|
31 | int sc_main (int argc, char * argv[]) |
---|
32 | #endif |
---|
33 | { |
---|
34 | if (argc < static_cast<int>(2+NB_PARAMS)) |
---|
35 | usage (argc, argv); |
---|
36 | |
---|
37 | uint32_t x = 1; |
---|
38 | |
---|
39 | const string name = argv[x++]; |
---|
40 | |
---|
41 | uint32_t _nb_front_end = atoi(argv[x++]); |
---|
42 | |
---|
43 | if (argc != static_cast<int>(2+NB_PARAMS+_nb_front_end)) |
---|
44 | usage (argc, argv); |
---|
45 | |
---|
46 | uint32_t * _nb_context = new uint32_t [_nb_front_end]; |
---|
47 | for (uint32_t i=0; i<_nb_front_end; i++) |
---|
48 | _nb_context [i] = atoi(argv[x++]); |
---|
49 | |
---|
50 | uint32_t _nb_general_register = atoi(argv[x++]); |
---|
51 | uint32_t _nb_special_register = atoi(argv[x++]); |
---|
52 | uint32_t _nb_inst_insert = atoi(argv[x++]); |
---|
53 | uint32_t _nb_inst_retire = atoi(argv[x++]); |
---|
54 | uint32_t _nb_reg_free = atoi(argv[x++]); |
---|
55 | uint32_t _nb_bank = atoi(argv[x++]); |
---|
56 | |
---|
57 | try |
---|
58 | { |
---|
59 | 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 |
---|
60 | (_nb_front_end , |
---|
61 | _nb_context , |
---|
62 | _nb_general_register , |
---|
63 | _nb_special_register , |
---|
64 | _nb_inst_insert , |
---|
65 | _nb_inst_retire , |
---|
66 | _nb_reg_free , |
---|
67 | _nb_bank , |
---|
68 | true //is_toplevel |
---|
69 | ); |
---|
70 | |
---|
71 | msg(_("%s"),param->print(1).c_str()); |
---|
72 | |
---|
73 | test (name,param); |
---|
74 | } |
---|
75 | catch (morpheo::ErrorMorpheo & error) |
---|
76 | { |
---|
77 | msg (_("<%s> : %s.\n"),name.c_str(), error.what ()); |
---|
78 | exit (EXIT_FAILURE); |
---|
79 | } |
---|
80 | catch (...) |
---|
81 | { |
---|
82 | err (_("<%s> : This test must generate a error.\n"),name.c_str()); |
---|
83 | exit (EXIT_FAILURE); |
---|
84 | } |
---|
85 | |
---|
86 | delete [] _nb_context; |
---|
87 | |
---|
88 | return (EXIT_SUCCESS); |
---|
89 | } |
---|
90 | |
---|