1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/include/test.h" |
---|
9 | |
---|
10 | #define NB_PARAMS 16 |
---|
11 | |
---|
12 | void usage (int argc, char * argv[]) |
---|
13 | { |
---|
14 | cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl |
---|
15 | << "list_params is :" << endl |
---|
16 | << " - size_queue (unsigned int)" << endl |
---|
17 | << " - nb_inst_retire (unsigned int)" << endl |
---|
18 | << " - nb_context (unsigned int)" << endl |
---|
19 | << " - nb_front_end (unsigned int)" << endl |
---|
20 | << " - nb_ooo_engine (unsigned int)" << endl |
---|
21 | << " - nb_packet (unsigned int)" << endl |
---|
22 | << " - size_general_data (unsigned int)" << endl |
---|
23 | << " - size_special_data (unsigned int)" << endl |
---|
24 | << " - nb_general_register (unsigned int)" << endl |
---|
25 | << " - nb_special_register (unsigned int)" << endl |
---|
26 | << " - nb_operation (unsigned int)" << endl |
---|
27 | << " - nb_type (unsigned int)" << endl |
---|
28 | << " - nb_gpr_write (unsigned int)" << endl |
---|
29 | << " - nb_spr_write (unsigned int)" << endl |
---|
30 | << " - nb_bypass_write (unsigned int)" << endl |
---|
31 | << " - nb_bypass_memory (unsigned int)" << endl |
---|
32 | << "" << endl; |
---|
33 | |
---|
34 | for (int i=0; i<argc; i++) |
---|
35 | cerr << argv[i] << " "; |
---|
36 | cerr << endl; |
---|
37 | |
---|
38 | exit (1); |
---|
39 | } |
---|
40 | |
---|
41 | #ifndef SYSTEMC |
---|
42 | int main (int argc, char * argv[]) |
---|
43 | #else |
---|
44 | int sc_main (int argc, char * argv[]) |
---|
45 | #endif |
---|
46 | { |
---|
47 | if (argc != 2+NB_PARAMS) |
---|
48 | usage (argc, argv); |
---|
49 | |
---|
50 | uint32_t x=1; |
---|
51 | const string name = argv[x++]; |
---|
52 | const uint32_t size_queue = atoi(argv[x++]); |
---|
53 | const uint32_t nb_inst_retire = atoi(argv[x++]); |
---|
54 | const uint32_t nb_context = atoi(argv[x++]); |
---|
55 | const uint32_t nb_front_end = atoi(argv[x++]); |
---|
56 | const uint32_t nb_ooo_engine = atoi(argv[x++]); |
---|
57 | const uint32_t nb_packet = atoi(argv[x++]); |
---|
58 | const uint32_t size_general_data = atoi(argv[x++]); |
---|
59 | const uint32_t size_special_data = atoi(argv[x++]); |
---|
60 | const uint32_t nb_general_register = atoi(argv[x++]); |
---|
61 | const uint32_t nb_special_register = atoi(argv[x++]); |
---|
62 | const uint32_t nb_operation = atoi(argv[x++]); |
---|
63 | const uint32_t nb_type = atoi(argv[x++]); |
---|
64 | const uint32_t nb_gpr_write = atoi(argv[x++]); |
---|
65 | const uint32_t nb_spr_write = atoi(argv[x++]); |
---|
66 | const uint32_t nb_bypass_write = atoi(argv[x++]); |
---|
67 | const uint32_t nb_bypass_memory = atoi(argv[x++]); |
---|
68 | |
---|
69 | try |
---|
70 | { |
---|
71 | morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Parameters |
---|
72 | (size_queue |
---|
73 | ,nb_inst_retire |
---|
74 | ,nb_context |
---|
75 | ,nb_front_end |
---|
76 | ,nb_ooo_engine |
---|
77 | ,nb_packet |
---|
78 | ,size_general_data |
---|
79 | ,size_special_data |
---|
80 | ,nb_general_register |
---|
81 | ,nb_special_register |
---|
82 | ,nb_operation |
---|
83 | ,nb_type |
---|
84 | ,nb_gpr_write |
---|
85 | ,nb_spr_write |
---|
86 | ,nb_bypass_write |
---|
87 | ,nb_bypass_memory |
---|
88 | ); |
---|
89 | |
---|
90 | cout << param->print(1); |
---|
91 | |
---|
92 | test (name,param); |
---|
93 | } |
---|
94 | catch (morpheo::ErrorMorpheo & error) |
---|
95 | { |
---|
96 | cout << "<" << name << "> : " << error.what (); |
---|
97 | exit (EXIT_FAILURE); |
---|
98 | } |
---|
99 | catch (...) |
---|
100 | { |
---|
101 | cerr << "<" << name << "> : This test must generate a error" << endl; |
---|
102 | exit (EXIT_FAILURE); |
---|
103 | } |
---|
104 | |
---|
105 | return (EXIT_SUCCESS); |
---|
106 | } |
---|
107 | |
---|