1 | /* |
---|
2 | * $Id: Prediction_unit.cpp 138 2010-05-12 17:34:01Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/include/Prediction_unit.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_front_end { |
---|
14 | namespace front_end { |
---|
15 | namespace prediction_unit { |
---|
16 | |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Prediction_unit::Prediction_unit" |
---|
20 | Prediction_unit::Prediction_unit |
---|
21 | ( |
---|
22 | #ifdef SYSTEMC |
---|
23 | sc_module_name name, |
---|
24 | #else |
---|
25 | string name, |
---|
26 | #endif |
---|
27 | #ifdef STATISTICS |
---|
28 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
29 | #endif |
---|
30 | morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::Parameters * param, |
---|
31 | morpheo::behavioural::Tusage_t usage |
---|
32 | ): |
---|
33 | _name (name) |
---|
34 | ,_param (param) |
---|
35 | ,_usage (usage) |
---|
36 | { |
---|
37 | log_printf(FUNC,Prediction_unit,FUNCTION,"Begin"); |
---|
38 | |
---|
39 | // #if DEBUG_Prediction_unit == true |
---|
40 | // log_printf(INFO,Prediction_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
41 | |
---|
42 | // std::cout << *param << std::endl; |
---|
43 | // #endif |
---|
44 | |
---|
45 | log_printf(INFO,Prediction_unit,FUNCTION,"Allocation"); |
---|
46 | |
---|
47 | allocation ( |
---|
48 | #ifdef STATISTICS |
---|
49 | param_statistics |
---|
50 | #endif |
---|
51 | ); |
---|
52 | |
---|
53 | #ifdef STATISTICS |
---|
54 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
55 | { |
---|
56 | log_printf(INFO,Prediction_unit,FUNCTION,"Allocation of statistics"); |
---|
57 | |
---|
58 | statistics_allocation(param_statistics); |
---|
59 | } |
---|
60 | #endif |
---|
61 | |
---|
62 | #ifdef VHDL |
---|
63 | if (usage_is_set(_usage,USE_VHDL)) |
---|
64 | { |
---|
65 | // generate the vhdl |
---|
66 | log_printf(INFO,Prediction_unit,FUNCTION,"Generate the vhdl"); |
---|
67 | |
---|
68 | vhdl(); |
---|
69 | } |
---|
70 | #endif |
---|
71 | |
---|
72 | #if defined(SYSTEMC) and (defined(STATISTICS) or defined(VHDL_TESTBENCH)) |
---|
73 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
74 | { |
---|
75 | log_printf(INFO,Prediction_unit,FUNCTION,"Method - transition"); |
---|
76 | |
---|
77 | SC_METHOD (transition); |
---|
78 | dont_initialize (); |
---|
79 | sensitive << (*(in_CLOCK)).pos(); |
---|
80 | |
---|
81 | # ifdef SYSTEMCASS_SPECIFIC |
---|
82 | // List dependency information |
---|
83 | # endif |
---|
84 | } |
---|
85 | #endif |
---|
86 | log_printf(FUNC,Prediction_unit,FUNCTION,"End"); |
---|
87 | }; |
---|
88 | |
---|
89 | #undef FUNCTION |
---|
90 | #define FUNCTION "Prediction_unit::~Prediction_unit" |
---|
91 | Prediction_unit::~Prediction_unit (void) |
---|
92 | { |
---|
93 | log_printf(FUNC,Prediction_unit,FUNCTION,"Begin"); |
---|
94 | |
---|
95 | #ifdef STATISTICS |
---|
96 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
97 | { |
---|
98 | statistics_deallocation(); |
---|
99 | } |
---|
100 | #endif |
---|
101 | |
---|
102 | log_printf(INFO,Prediction_unit,FUNCTION,"Deallocation"); |
---|
103 | deallocation (); |
---|
104 | |
---|
105 | log_printf(FUNC,Prediction_unit,FUNCTION,"End"); |
---|
106 | }; |
---|
107 | |
---|
108 | }; // end namespace prediction_unit |
---|
109 | }; // end namespace front_end |
---|
110 | }; // end namespace multi_front_end |
---|
111 | }; // end namespace core |
---|
112 | |
---|
113 | }; // end namespace behavioural |
---|
114 | }; // end namespace morpheo |
---|