1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h" |
---|
9 | |
---|
10 | #define number_of_test 2 |
---|
11 | |
---|
12 | #define NB_PARAMS 13 |
---|
13 | |
---|
14 | void usage (int argc, char * argv[]) |
---|
15 | { |
---|
16 | cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl |
---|
17 | << "list_params is :" << endl |
---|
18 | << " - size_store_queue (uint32_t)" << endl |
---|
19 | << " - size_load_queue (uint32_t)" << endl |
---|
20 | << " - size_speculative_access_queue (uint32_t)" << endl |
---|
21 | << " - nb_port_check (uint32_t)" << endl |
---|
22 | << " - speculative_load (uint32_t)" << endl |
---|
23 | << " - nb_context (uint32_t)" << endl |
---|
24 | << " - nb_front_end (uint32_t)" << endl |
---|
25 | << " - nb_ooo_engine (uint32_t)" << endl |
---|
26 | << " - nb_packet (uint32_t)" << endl |
---|
27 | << " - size_general_data (uint32_t)" << endl |
---|
28 | << " - nb_general_register (uint32_t)" << endl |
---|
29 | << " - nb_operation (uint32_t)" << endl |
---|
30 | << " - nb_type (uint32_t)" << endl |
---|
31 | << "" << endl; |
---|
32 | |
---|
33 | for (int i=0; i<argc; i++) |
---|
34 | cerr << argv[i] << " "; |
---|
35 | cerr << endl; |
---|
36 | |
---|
37 | exit (1); |
---|
38 | } |
---|
39 | |
---|
40 | #ifndef SYSTEMC |
---|
41 | int main (int argc, char * argv[]) |
---|
42 | #else |
---|
43 | int sc_main (int argc, char * argv[]) |
---|
44 | #endif |
---|
45 | { |
---|
46 | switch (number_of_test) |
---|
47 | { |
---|
48 | case 1 : |
---|
49 | { |
---|
50 | |
---|
51 | if (argc != 2+NB_PARAMS) |
---|
52 | usage (argc, argv); |
---|
53 | |
---|
54 | uint32_t x=1; |
---|
55 | |
---|
56 | const string name = argv[x++]; |
---|
57 | const uint32_t _size_store_queue = atoi(argv[x++]); |
---|
58 | const uint32_t _size_load_queue = atoi(argv[x++]); |
---|
59 | const uint32_t _size_speculative_access_queue = atoi(argv[x++]); |
---|
60 | const uint32_t _nb_port_check = atoi(argv[x++]); |
---|
61 | const Tspeculative_load_t _speculative_load = fromString<Tspeculative_load_t>(argv[x++]); |
---|
62 | const uint32_t _nb_context = atoi(argv[x++]); |
---|
63 | const uint32_t _nb_front_end = atoi(argv[x++]); |
---|
64 | const uint32_t _nb_ooo_engine = atoi(argv[x++]); |
---|
65 | const uint32_t _nb_packet = atoi(argv[x++]); |
---|
66 | const uint32_t _size_general_data = atoi(argv[x++]); |
---|
67 | const uint32_t _nb_general_register = atoi(argv[x++]); |
---|
68 | const uint32_t _nb_operation = atoi(argv[x++]); |
---|
69 | const uint32_t _nb_type = atoi(argv[x++]); |
---|
70 | |
---|
71 | try |
---|
72 | { |
---|
73 | morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters |
---|
74 | ( |
---|
75 | _size_store_queue , |
---|
76 | _size_load_queue , |
---|
77 | _size_speculative_access_queue, |
---|
78 | _nb_port_check , |
---|
79 | _speculative_load , |
---|
80 | _nb_context , |
---|
81 | _nb_front_end , |
---|
82 | _nb_ooo_engine , |
---|
83 | _nb_packet , |
---|
84 | _size_general_data , |
---|
85 | _nb_general_register , |
---|
86 | _nb_operation , |
---|
87 | _nb_type |
---|
88 | ); |
---|
89 | |
---|
90 | cout << param->print(1); |
---|
91 | |
---|
92 | test1 (name,param); |
---|
93 | |
---|
94 | } |
---|
95 | catch (morpheo::ErrorMorpheo & error) |
---|
96 | { |
---|
97 | cout << "<" << name << "> : " << error.what (); |
---|
98 | exit (EXIT_FAILURE); |
---|
99 | } |
---|
100 | catch (...) |
---|
101 | { |
---|
102 | cerr << "<" << name << "> : This test must generate a error" << endl; |
---|
103 | exit (EXIT_FAILURE); |
---|
104 | } |
---|
105 | |
---|
106 | break; |
---|
107 | } |
---|
108 | case 2 : |
---|
109 | { |
---|
110 | try |
---|
111 | { |
---|
112 | test2 (); |
---|
113 | } |
---|
114 | catch (morpheo::ErrorMorpheo & error) |
---|
115 | { |
---|
116 | cout << error.what (); |
---|
117 | exit (EXIT_FAILURE); |
---|
118 | } |
---|
119 | catch (...) |
---|
120 | { |
---|
121 | cerr << "This test must generate a error" << endl; |
---|
122 | exit (EXIT_FAILURE); |
---|
123 | } |
---|
124 | |
---|
125 | break; |
---|
126 | } |
---|
127 | default : |
---|
128 | { |
---|
129 | std::cerr << "Invalid number of test" << std::endl; |
---|
130 | exit (EXIT_FAILURE); |
---|
131 | |
---|
132 | break; |
---|
133 | } |
---|
134 | } |
---|
135 | |
---|
136 | return (EXIT_SUCCESS); |
---|
137 | } |
---|
138 | |
---|