1 | /* |
---|
2 | * $Id: Morpheo.cpp 110 2009-02-19 16:31:47Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "TopLevel/include/Morpheo.h" |
---|
9 | #include "Common/include/Translation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | |
---|
13 | using namespace behavioural; |
---|
14 | |
---|
15 | #undef FUNCTION |
---|
16 | #define FUNCTION "Morpheo::Morpheo" |
---|
17 | Morpheo::Morpheo |
---|
18 | ( |
---|
19 | #ifdef SYSTEMC |
---|
20 | sc_module_name name, |
---|
21 | #else |
---|
22 | std::string name, |
---|
23 | #endif |
---|
24 | std::string filename_simulator, |
---|
25 | std::string filename_generator, |
---|
26 | std::string filename_instance , |
---|
27 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void) |
---|
28 | ) |
---|
29 | { |
---|
30 | translation (); |
---|
31 | |
---|
32 | log_begin(Morpheo,FUNCTION); |
---|
33 | |
---|
34 | log_printf(INFO,Morpheo,FUNCTION,_("Configuration")); |
---|
35 | configuration (filename_simulator, |
---|
36 | filename_generator, |
---|
37 | filename_instance, |
---|
38 | get_custom_information); |
---|
39 | |
---|
40 | log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Allocation"),_name.c_str()); |
---|
41 | |
---|
42 | allocation ( |
---|
43 | #ifdef STATISTICS |
---|
44 | _param_statistics |
---|
45 | #endif |
---|
46 | ); |
---|
47 | |
---|
48 | #ifdef STATISTICS |
---|
49 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
50 | { |
---|
51 | log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str()); |
---|
52 | |
---|
53 | statistics_allocation(_param_statistics); |
---|
54 | } |
---|
55 | #endif |
---|
56 | |
---|
57 | #ifdef VHDL |
---|
58 | if (usage_is_set(_usage,USE_VHDL)) |
---|
59 | { |
---|
60 | // generate the vhdl |
---|
61 | log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
62 | |
---|
63 | vhdl(); |
---|
64 | } |
---|
65 | #endif |
---|
66 | |
---|
67 | #ifdef SYSTEMC |
---|
68 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
69 | { |
---|
70 | log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); |
---|
71 | |
---|
72 | SC_METHOD (transition); |
---|
73 | dont_initialize (); |
---|
74 | sensitive << (*(in_CLOCK)).pos(); |
---|
75 | |
---|
76 | # ifdef SYSTEMCASS_SPECIFIC |
---|
77 | // List dependency information |
---|
78 | # endif |
---|
79 | |
---|
80 | #endif |
---|
81 | } |
---|
82 | |
---|
83 | #ifdef SYSTEMC |
---|
84 | // Stop alarm |
---|
85 | signal_init(); |
---|
86 | #endif |
---|
87 | |
---|
88 | log_end(Morpheo,FUNCTION); |
---|
89 | }; |
---|
90 | |
---|
91 | #undef FUNCTION |
---|
92 | #define FUNCTION "Morpheo::~Morpheo" |
---|
93 | Morpheo::~Morpheo (void) |
---|
94 | { |
---|
95 | log_begin(Morpheo,FUNCTION); |
---|
96 | |
---|
97 | #ifdef SYSTEMC |
---|
98 | // Stop alarm |
---|
99 | alarm(0); |
---|
100 | #endif |
---|
101 | |
---|
102 | #ifdef STATISTICS |
---|
103 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
104 | { |
---|
105 | statistics_deallocation(); |
---|
106 | } |
---|
107 | #endif |
---|
108 | |
---|
109 | log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
110 | deallocation (); |
---|
111 | |
---|
112 | delete _param_core; |
---|
113 | delete _config; |
---|
114 | |
---|
115 | log_end(Morpheo,FUNCTION); |
---|
116 | }; |
---|
117 | |
---|
118 | }; // end namespace morpheo |
---|