1 | /* |
---|
2 | * $Id: test.cpp 97 2008-12-19 15:34:00Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | * Test |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Configuration/SelfTest/include/test.h" |
---|
10 | #include "Behavioural/Custom/include/Custom_default.h" |
---|
11 | #include "Behavioural/Custom/include/Custom_example.h" |
---|
12 | #include "Common/include/Time.h" |
---|
13 | |
---|
14 | void test (string name) |
---|
15 | { |
---|
16 | Time * timing = new Time (false); |
---|
17 | |
---|
18 | morpheo::behavioural::custom::custom_information_t (*_get_custom_information) (void) = &(morpheo::behavioural::custom::default_get_custom_information); |
---|
19 | |
---|
20 | cout << "------------------------------------------------------" << endl; |
---|
21 | |
---|
22 | Simulator * simulator1 = new Simulator ("../../../Files/Morpheo.sim"); |
---|
23 | |
---|
24 | //cout << *simulator1 << endl; |
---|
25 | |
---|
26 | simulator1->toFile("data_out"); |
---|
27 | |
---|
28 | cout << "------------------------------------------------------" << endl; |
---|
29 | |
---|
30 | Generator * generator1 = new Generator ("../../../Files/Morpheo.gen"); |
---|
31 | |
---|
32 | //cout << *generator1 << endl; |
---|
33 | |
---|
34 | generator1->toFile("data_out"); |
---|
35 | |
---|
36 | cout << "------------------------------------------------------" << endl; |
---|
37 | |
---|
38 | Instance * instance1 = new Instance ("../../../Files/Instance_min.cfg", |
---|
39 | generator1, |
---|
40 | _get_custom_information |
---|
41 | ); |
---|
42 | |
---|
43 | // cout << *instance1 << endl; |
---|
44 | |
---|
45 | instance1->toFile("data_out"); |
---|
46 | |
---|
47 | cout << "------------------------------------------------------" << endl; |
---|
48 | |
---|
49 | Configuration * configuration1 = new Configuration("../../../Files/Morpheo.sim", |
---|
50 | "../../../Files/Morpheo.gen", |
---|
51 | "../../../Files/Instance_min.cfg", |
---|
52 | _get_custom_information); |
---|
53 | |
---|
54 | //cout << *configuration1 << endl; |
---|
55 | |
---|
56 | configuration1->toFile("data_out"); |
---|
57 | |
---|
58 | { |
---|
59 | cout << "------------------------------------------------------" << endl; |
---|
60 | |
---|
61 | Instance * instance = new Instance ("../../../Files/Instance_scalar_1.cfg", |
---|
62 | generator1, |
---|
63 | _get_custom_information |
---|
64 | ); |
---|
65 | instance->toFile("data_out"); |
---|
66 | |
---|
67 | delete instance; |
---|
68 | } |
---|
69 | |
---|
70 | { |
---|
71 | cout << "------------------------------------------------------" << endl; |
---|
72 | |
---|
73 | Instance * instance = new Instance ("../../../Files/Instance_scalar_2.cfg", |
---|
74 | generator1, |
---|
75 | _get_custom_information |
---|
76 | ); |
---|
77 | instance->toFile("data_out"); |
---|
78 | |
---|
79 | delete instance; |
---|
80 | } |
---|
81 | |
---|
82 | delete configuration1; |
---|
83 | delete instance1; |
---|
84 | delete generator1; |
---|
85 | delete simulator1; |
---|
86 | delete timing; |
---|
87 | } |
---|