1 | /* |
---|
2 | * $Id: Meta_Predictor_Glue.cpp 132 2009-07-11 16:39:35Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.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 | namespace direction { |
---|
17 | namespace meta_predictor { |
---|
18 | namespace meta_predictor_glue { |
---|
19 | |
---|
20 | |
---|
21 | #undef FUNCTION |
---|
22 | #define FUNCTION "Meta_Predictor_Glue::Meta_Predictor_Glue" |
---|
23 | Meta_Predictor_Glue::Meta_Predictor_Glue |
---|
24 | ( |
---|
25 | #ifdef SYSTEMC |
---|
26 | sc_module_name name, |
---|
27 | #else |
---|
28 | string name, |
---|
29 | #endif |
---|
30 | #ifdef STATISTICS |
---|
31 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
32 | #endif |
---|
33 | morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Parameters * param, |
---|
34 | morpheo::behavioural::Tusage_t usage |
---|
35 | ): |
---|
36 | _name (name) |
---|
37 | ,_param (param) |
---|
38 | ,_usage (usage) |
---|
39 | { |
---|
40 | log_begin(Meta_Predictor_Glue,FUNCTION); |
---|
41 | |
---|
42 | usage_environment(_usage); |
---|
43 | |
---|
44 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Allocation"),_name.c_str()); |
---|
45 | |
---|
46 | allocation ( |
---|
47 | #ifdef STATISTICS |
---|
48 | param_statistics |
---|
49 | #endif |
---|
50 | ); |
---|
51 | |
---|
52 | #ifdef STATISTICS |
---|
53 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
54 | { |
---|
55 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str()); |
---|
56 | |
---|
57 | statistics_allocation(param_statistics); |
---|
58 | } |
---|
59 | #endif |
---|
60 | |
---|
61 | #ifdef VHDL |
---|
62 | if (usage_is_set(_usage,USE_VHDL)) |
---|
63 | { |
---|
64 | // generate the vhdl |
---|
65 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
66 | |
---|
67 | vhdl(); |
---|
68 | } |
---|
69 | #endif |
---|
70 | |
---|
71 | #ifdef SYSTEMC |
---|
72 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
73 | { |
---|
74 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); |
---|
75 | |
---|
76 | SC_METHOD (transition); |
---|
77 | dont_initialize (); |
---|
78 | sensitive << (*(in_CLOCK)).pos(); |
---|
79 | |
---|
80 | # ifdef SYSTEMCASS_SPECIFIC |
---|
81 | // List dependency information |
---|
82 | # endif |
---|
83 | |
---|
84 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_update_valack"),_name.c_str()); |
---|
85 | |
---|
86 | SC_METHOD (genMealy_update_valack); |
---|
87 | dont_initialize (); |
---|
88 | // sensitive << (*(in_CLOCK)).neg(); // don't need internal register |
---|
89 | sensitive << (*(in_NRESET)); |
---|
90 | for (uint32_t i=0; i<_param->_nb_inst_update; ++i) |
---|
91 | { |
---|
92 | sensitive << (*(in_UPDATE_VAL [i])); |
---|
93 | |
---|
94 | for (uint32_t j=0; j<_param->_nb_predictor; ++j) |
---|
95 | sensitive << (*(in_UPDATE_PREDICTOR_ACK [j][i])); |
---|
96 | } |
---|
97 | |
---|
98 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_update"),_name.c_str()); |
---|
99 | |
---|
100 | SC_METHOD (genMealy_update); |
---|
101 | dont_initialize (); |
---|
102 | // sensitive << (*(in_CLOCK)).neg(); // don't need internal register |
---|
103 | sensitive << (*(in_NRESET)); |
---|
104 | for (uint32_t i=0; i<_param->_nb_inst_update; ++i) |
---|
105 | sensitive << (*(in_UPDATE_HISTORY [i])) |
---|
106 | << (*(in_UPDATE_HISTORY_VAL [i])) |
---|
107 | << (*(in_UPDATE_DIRECTION [i])); |
---|
108 | |
---|
109 | # ifdef SYSTEMCASS_SPECIFIC |
---|
110 | // List dependency information |
---|
111 | # endif |
---|
112 | |
---|
113 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict_valack"),_name.c_str()); |
---|
114 | |
---|
115 | SC_METHOD (genMealy_predict_valack); |
---|
116 | dont_initialize (); |
---|
117 | // sensitive << (*(in_CLOCK)).neg(); // don't need internal register |
---|
118 | sensitive << (*(in_NRESET)); |
---|
119 | for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) |
---|
120 | { |
---|
121 | sensitive << (*(in_PREDICT_VAL [i])); |
---|
122 | |
---|
123 | for (uint32_t j=0; j<_param->_nb_predictor; ++j) |
---|
124 | sensitive << (*(in_PREDICT_PREDICTOR_ACK [j][i])); |
---|
125 | } |
---|
126 | |
---|
127 | # ifdef SYSTEMCASS_SPECIFIC |
---|
128 | // List dependency information |
---|
129 | # endif |
---|
130 | |
---|
131 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict"),_name.c_str()); |
---|
132 | |
---|
133 | SC_METHOD (genMealy_predict); |
---|
134 | dont_initialize (); |
---|
135 | // sensitive << (*(in_CLOCK)).neg(); // don't need internal register |
---|
136 | sensitive << (*(in_NRESET)); |
---|
137 | for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) |
---|
138 | for (uint32_t j=0; j<_param->_nb_predictor; ++j) |
---|
139 | sensitive << (*(in_PREDICT_PREDICTOR_HISTORY [j][i])) |
---|
140 | << (*(in_PREDICT_PREDICTOR_DIRECTION [j][i])); |
---|
141 | |
---|
142 | # ifdef SYSTEMCASS_SPECIFIC |
---|
143 | // List dependency information |
---|
144 | # endif |
---|
145 | |
---|
146 | #endif |
---|
147 | } |
---|
148 | log_end(Meta_Predictor_Glue,FUNCTION); |
---|
149 | }; |
---|
150 | |
---|
151 | #undef FUNCTION |
---|
152 | #define FUNCTION "Meta_Predictor_Glue::~Meta_Predictor_Glue" |
---|
153 | Meta_Predictor_Glue::~Meta_Predictor_Glue (void) |
---|
154 | { |
---|
155 | log_begin(Meta_Predictor_Glue,FUNCTION); |
---|
156 | |
---|
157 | #ifdef STATISTICS |
---|
158 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
159 | { |
---|
160 | statistics_deallocation(); |
---|
161 | } |
---|
162 | #endif |
---|
163 | |
---|
164 | log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
165 | deallocation (); |
---|
166 | |
---|
167 | log_end(Meta_Predictor_Glue,FUNCTION); |
---|
168 | }; |
---|
169 | |
---|
170 | }; // end namespace meta_predictor_glue |
---|
171 | }; // end namespace meta_predictor |
---|
172 | }; // end namespace direction |
---|
173 | }; // end namespace prediction_unit |
---|
174 | }; // end namespace front_end |
---|
175 | }; // end namespace multi_front_end |
---|
176 | }; // end namespace core |
---|
177 | |
---|
178 | }; // end namespace behavioural |
---|
179 | }; // end namespace morpheo |
---|