1 | /* |
---|
2 | * $Id: Decod.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_front_end { |
---|
14 | namespace front_end { |
---|
15 | namespace decod_unit { |
---|
16 | namespace decod { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Decod::Decod" |
---|
21 | Decod::Decod |
---|
22 | ( |
---|
23 | #ifdef SYSTEMC |
---|
24 | sc_module_name name, |
---|
25 | #else |
---|
26 | string name, |
---|
27 | #endif |
---|
28 | #ifdef STATISTICS |
---|
29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
30 | #endif |
---|
31 | morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Parameters * param, |
---|
32 | morpheo::behavioural::Tusage_t usage |
---|
33 | ): |
---|
34 | _name (name) |
---|
35 | ,_param (param) |
---|
36 | ,_usage (usage) |
---|
37 | { |
---|
38 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
39 | |
---|
40 | log_printf(INFO,Decod,FUNCTION,"Allocation"); |
---|
41 | |
---|
42 | allocation ( |
---|
43 | #ifdef STATISTICS |
---|
44 | param_statistics |
---|
45 | #endif |
---|
46 | ); |
---|
47 | |
---|
48 | #ifdef STATISTICS |
---|
49 | if (_usage & USE_STATISTICS) |
---|
50 | { |
---|
51 | log_printf(INFO,Decod,FUNCTION,"Allocation of statistics"); |
---|
52 | |
---|
53 | statistics_allocation(param_statistics); |
---|
54 | } |
---|
55 | #endif |
---|
56 | |
---|
57 | #ifdef VHDL |
---|
58 | if (_usage & USE_VHDL) |
---|
59 | { |
---|
60 | // generate the vhdl |
---|
61 | log_printf(INFO,Decod,FUNCTION,"Generate the vhdl"); |
---|
62 | |
---|
63 | vhdl(); |
---|
64 | } |
---|
65 | #endif |
---|
66 | |
---|
67 | #ifdef SYSTEMC |
---|
68 | if (_usage & USE_SYSTEMC) |
---|
69 | { |
---|
70 | log_printf(INFO,Decod,FUNCTION,"Method - transition"); |
---|
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 | log_printf(INFO,Decod,FUNCTION,"Method - genMealy"); |
---|
81 | |
---|
82 | SC_METHOD (genMealy); |
---|
83 | dont_initialize (); |
---|
84 | sensitive << (*(in_CLOCK)).neg() //use internal register |
---|
85 | << (*(in_CONTEXT_EVENT_ACK)); |
---|
86 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
87 | { |
---|
88 | for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; j++) |
---|
89 | sensitive << (*(in_IFETCH_VAL [i][j])) |
---|
90 | << (*(in_IFETCH_INSTRUCTION [i][j])); |
---|
91 | sensitive << (*(in_IFETCH_ADDRESS [i])) |
---|
92 | // << (*(in_IFETCH_ADDRESS_NEXT [i])) |
---|
93 | << (*(in_IFETCH_BRANCH_STATE [i])) |
---|
94 | << (*(in_CONTEXT_DECOD_ENABLE [i])); |
---|
95 | if (_param->_have_port_context_id) |
---|
96 | sensitive << (*(in_IFETCH_CONTEXT_ID [i])); |
---|
97 | if (_param->_have_port_branch_update_prediction_id) |
---|
98 | sensitive << (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i])); |
---|
99 | if (_param->_have_port_depth) |
---|
100 | sensitive << (*(in_CONTEXT_DEPTH [i])); |
---|
101 | if (_param->_have_port_inst_ifetch_ptr) |
---|
102 | sensitive << (*(in_IFETCH_INST_IFETCH_PTR [i])); |
---|
103 | } |
---|
104 | |
---|
105 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
106 | sensitive << (*(in_DECOD_ACK [i])) |
---|
107 | << (*(in_PREDICT_ACK [i])) |
---|
108 | // << (*(in_PREDICT_CAN_CONTINUE [i])) |
---|
109 | ; |
---|
110 | |
---|
111 | # ifdef SYSTEMCASS_SPECIFIC |
---|
112 | // List dependency information |
---|
113 | |
---|
114 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
115 | { |
---|
116 | for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; j++) |
---|
117 | { |
---|
118 | (*(out_IFETCH_ACK [i][j])) (*(in_IFETCH_VAL [i][j])); |
---|
119 | (*(out_IFETCH_ACK [i][j])) (*(in_IFETCH_INSTRUCTION [i][j])); |
---|
120 | if (_param->_have_port_context_id) |
---|
121 | (*(out_IFETCH_ACK [i][j])) (*(in_IFETCH_CONTEXT_ID [i] )); |
---|
122 | (*(out_IFETCH_ACK [i][j])) (*(in_CONTEXT_DECOD_ENABLE [i] )); |
---|
123 | (*(out_IFETCH_ACK [i][j])) (*(in_CONTEXT_EVENT_ACK )); |
---|
124 | for (uint32_t x=0; x<_param->_nb_inst_decod; x++) |
---|
125 | { |
---|
126 | (*(out_IFETCH_ACK [i][j])) (*(in_DECOD_ACK [x])); |
---|
127 | (*(out_IFETCH_ACK [i][j])) (*(in_PREDICT_ACK [x])); |
---|
128 | // (*(out_IFETCH_ACK [i][j])) (*(in_PREDICT_CAN_CONTINUE [x])); |
---|
129 | } |
---|
130 | } |
---|
131 | } |
---|
132 | |
---|
133 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
134 | { |
---|
135 | |
---|
136 | (*(out_DECOD_VAL [i])) (*(in_PREDICT_ACK [i])); |
---|
137 | // (*(out_DECOD_VAL [i])) (*(in_PREDICT_CAN_CONTINUE [i])); |
---|
138 | (*(out_DECOD_VAL [i])) (*(in_CONTEXT_EVENT_ACK )); |
---|
139 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
140 | { |
---|
141 | (*(out_DECOD_VAL [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
142 | if (_param->_have_port_context_id) |
---|
143 | (*(out_DECOD_VAL [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
144 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
145 | { |
---|
146 | (*(out_DECOD_VAL [i])) (*(in_IFETCH_VAL [x][y])); |
---|
147 | (*(out_DECOD_VAL [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
148 | } |
---|
149 | } |
---|
150 | |
---|
151 | if (_param->_have_port_context_id) |
---|
152 | { |
---|
153 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
154 | { |
---|
155 | (*(out_DECOD_CONTEXT_ID [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
156 | (*(out_DECOD_CONTEXT_ID [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
157 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
158 | { |
---|
159 | (*(out_DECOD_CONTEXT_ID [i])) (*(in_IFETCH_VAL [x][y])); |
---|
160 | } |
---|
161 | } |
---|
162 | } |
---|
163 | |
---|
164 | if (_param->_have_port_depth) |
---|
165 | { |
---|
166 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
167 | { |
---|
168 | (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
169 | (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DEPTH [x])); |
---|
170 | if (_param->_have_port_context_id) |
---|
171 | (*(out_DECOD_DEPTH [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
172 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
173 | { |
---|
174 | (*(out_DECOD_DEPTH [i])) (*(in_IFETCH_VAL [x][y])); |
---|
175 | } |
---|
176 | } |
---|
177 | } |
---|
178 | |
---|
179 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
180 | { |
---|
181 | (*(out_DECOD_TYPE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
182 | if (_param->_have_port_context_id) |
---|
183 | (*(out_DECOD_TYPE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
184 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
185 | { |
---|
186 | (*(out_DECOD_TYPE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
187 | (*(out_DECOD_TYPE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
188 | } |
---|
189 | } |
---|
190 | |
---|
191 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
192 | { |
---|
193 | (*(out_DECOD_OPERATION [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
194 | if (_param->_have_port_context_id) |
---|
195 | (*(out_DECOD_OPERATION [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
196 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
197 | { |
---|
198 | (*(out_DECOD_OPERATION [i])) (*(in_IFETCH_VAL [x][y])); |
---|
199 | (*(out_DECOD_OPERATION [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
200 | } |
---|
201 | } |
---|
202 | |
---|
203 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
204 | { |
---|
205 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
206 | if (_param->_have_port_context_id) |
---|
207 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
208 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
209 | { |
---|
210 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_IFETCH_VAL [x][y])); |
---|
211 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
212 | } |
---|
213 | } |
---|
214 | |
---|
215 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
216 | { |
---|
217 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
218 | if (_param->_have_port_context_id) |
---|
219 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
220 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
221 | { |
---|
222 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_IFETCH_VAL [x][y])); |
---|
223 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
224 | } |
---|
225 | } |
---|
226 | |
---|
227 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
228 | { |
---|
229 | (*(out_DECOD_READ_RA [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
230 | if (_param->_have_port_context_id) |
---|
231 | (*(out_DECOD_READ_RA [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
232 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
233 | { |
---|
234 | (*(out_DECOD_READ_RA [i])) (*(in_IFETCH_VAL [x][y])); |
---|
235 | (*(out_DECOD_READ_RA [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
236 | } |
---|
237 | } |
---|
238 | |
---|
239 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
240 | { |
---|
241 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
242 | if (_param->_have_port_context_id) |
---|
243 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
244 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
245 | { |
---|
246 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_IFETCH_VAL [x][y])); |
---|
247 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
248 | } |
---|
249 | } |
---|
250 | |
---|
251 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
252 | { |
---|
253 | (*(out_DECOD_READ_RB [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
254 | if (_param->_have_port_context_id) |
---|
255 | (*(out_DECOD_READ_RB [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
256 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
257 | { |
---|
258 | (*(out_DECOD_READ_RB [i])) (*(in_IFETCH_VAL [x][y])); |
---|
259 | (*(out_DECOD_READ_RB [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
260 | } |
---|
261 | } |
---|
262 | |
---|
263 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
264 | { |
---|
265 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
266 | if (_param->_have_port_context_id) |
---|
267 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
268 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
269 | { |
---|
270 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_IFETCH_VAL [x][y])); |
---|
271 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
272 | } |
---|
273 | } |
---|
274 | |
---|
275 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
276 | { |
---|
277 | (*(out_DECOD_READ_RC [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
278 | if (_param->_have_port_context_id) |
---|
279 | (*(out_DECOD_READ_RC [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
280 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
281 | { |
---|
282 | (*(out_DECOD_READ_RC [i])) (*(in_IFETCH_VAL [x][y])); |
---|
283 | (*(out_DECOD_READ_RC [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
284 | } |
---|
285 | } |
---|
286 | |
---|
287 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
288 | { |
---|
289 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
290 | if (_param->_have_port_context_id) |
---|
291 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
292 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
293 | { |
---|
294 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_IFETCH_VAL [x][y])); |
---|
295 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
296 | } |
---|
297 | } |
---|
298 | |
---|
299 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
300 | { |
---|
301 | (*(out_DECOD_WRITE_RD [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
302 | if (_param->_have_port_context_id) |
---|
303 | (*(out_DECOD_WRITE_RD [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
304 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
305 | { |
---|
306 | (*(out_DECOD_WRITE_RD [i])) (*(in_IFETCH_VAL [x][y])); |
---|
307 | (*(out_DECOD_WRITE_RD [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
308 | } |
---|
309 | } |
---|
310 | |
---|
311 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
312 | { |
---|
313 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
314 | if (_param->_have_port_context_id) |
---|
315 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
316 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
317 | { |
---|
318 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_IFETCH_VAL [x][y])); |
---|
319 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
320 | } |
---|
321 | } |
---|
322 | |
---|
323 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
324 | { |
---|
325 | (*(out_DECOD_WRITE_RE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
326 | if (_param->_have_port_context_id) |
---|
327 | (*(out_DECOD_WRITE_RE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
328 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
329 | { |
---|
330 | (*(out_DECOD_WRITE_RE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
331 | (*(out_DECOD_WRITE_RE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
332 | } |
---|
333 | } |
---|
334 | |
---|
335 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
336 | { |
---|
337 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
338 | if (_param->_have_port_context_id) |
---|
339 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
340 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
341 | { |
---|
342 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
343 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
344 | } |
---|
345 | } |
---|
346 | |
---|
347 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
348 | { |
---|
349 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
350 | if (_param->_have_port_context_id) |
---|
351 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
352 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
353 | { |
---|
354 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
355 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
356 | } |
---|
357 | } |
---|
358 | |
---|
359 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
360 | { |
---|
361 | (*(out_DECOD_ADDRESS [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
362 | if (_param->_have_port_context_id) |
---|
363 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
364 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
365 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
366 | { |
---|
367 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_VAL [x][y])); |
---|
368 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
369 | } |
---|
370 | } |
---|
371 | |
---|
372 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
373 | { |
---|
374 | (*(out_DECOD_IMMEDIAT [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
375 | if (_param->_have_port_context_id) |
---|
376 | (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
377 | // (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_ADDRESS_NEXT [x])); |
---|
378 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
379 | { |
---|
380 | (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_VAL [x][y])); |
---|
381 | (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
382 | } |
---|
383 | } |
---|
384 | |
---|
385 | if (_param->_have_port_context_id) |
---|
386 | { |
---|
387 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
388 | { |
---|
389 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
390 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
391 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
392 | { |
---|
393 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_IFETCH_VAL [x][y])); |
---|
394 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
395 | } |
---|
396 | } |
---|
397 | } |
---|
398 | |
---|
399 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
400 | { |
---|
401 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
402 | if (_param->_have_port_context_id) |
---|
403 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
404 | if (_param->_have_port_inst_ifetch_ptr) |
---|
405 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_INST_IFETCH_PTR [x])); |
---|
406 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
407 | { |
---|
408 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_VAL [x][y])); |
---|
409 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
410 | } |
---|
411 | } |
---|
412 | |
---|
413 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
414 | { |
---|
415 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
416 | if (_param->_have_port_context_id) |
---|
417 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
418 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_BRANCH_STATE [x])); |
---|
419 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
420 | { |
---|
421 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
422 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
423 | } |
---|
424 | } |
---|
425 | |
---|
426 | if (_param->_have_port_branch_update_prediction_id) |
---|
427 | { |
---|
428 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
429 | { |
---|
430 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
431 | if (_param->_have_port_context_id) |
---|
432 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
433 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x])); |
---|
434 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
435 | { |
---|
436 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_VAL [x][y])); |
---|
437 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
438 | } |
---|
439 | } |
---|
440 | } |
---|
441 | |
---|
442 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
443 | { |
---|
444 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
445 | if (_param->_have_port_context_id) |
---|
446 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
447 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
448 | { |
---|
449 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_IFETCH_VAL [x][y])); |
---|
450 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
451 | } |
---|
452 | } |
---|
453 | |
---|
454 | // for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
455 | // { |
---|
456 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
457 | // if (_param->_have_port_context_id) |
---|
458 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
459 | // for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
460 | // { |
---|
461 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
462 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
463 | // } |
---|
464 | // } |
---|
465 | |
---|
466 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
467 | { |
---|
468 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
469 | if (_param->_have_port_context_id) |
---|
470 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
471 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
472 | { |
---|
473 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_IFETCH_VAL [x][y])); |
---|
474 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
475 | } |
---|
476 | } |
---|
477 | |
---|
478 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
479 | { |
---|
480 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
481 | if (_param->_have_port_context_id) |
---|
482 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
483 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
484 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
485 | { |
---|
486 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_VAL [x][y])); |
---|
487 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
488 | } |
---|
489 | |
---|
490 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
491 | if (_param->_have_port_context_id) |
---|
492 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
493 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
494 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
495 | { |
---|
496 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_VAL [x][y])); |
---|
497 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
498 | } |
---|
499 | |
---|
500 | } |
---|
501 | |
---|
502 | |
---|
503 | (*(out_PREDICT_VAL [i])) (*(in_CONTEXT_EVENT_ACK)); |
---|
504 | (*(out_PREDICT_VAL [i])) (*(in_DECOD_ACK [i])); |
---|
505 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
506 | { |
---|
507 | (*(out_PREDICT_VAL [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
508 | if (_param->_have_port_context_id) |
---|
509 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
510 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
511 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
512 | { |
---|
513 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_VAL [x][y])); |
---|
514 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
515 | } |
---|
516 | } |
---|
517 | } |
---|
518 | |
---|
519 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
520 | { |
---|
521 | (*(out_CONTEXT_EVENT_VAL)) (*(in_PREDICT_ACK [i])); |
---|
522 | // (*(out_CONTEXT_EVENT_VAL)) (*(in_PREDICT_CAN_CONTINUE [i])); |
---|
523 | (*(out_CONTEXT_EVENT_VAL)) (*(in_DECOD_ACK [i])); |
---|
524 | } |
---|
525 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
526 | { |
---|
527 | (*(out_CONTEXT_EVENT_VAL)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
528 | if (_param->_have_port_context_id) |
---|
529 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
530 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_ADDRESS [x])); |
---|
531 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
532 | { |
---|
533 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_VAL [x][y])); |
---|
534 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
535 | } |
---|
536 | } |
---|
537 | |
---|
538 | if (_param->_have_port_context_id) |
---|
539 | { |
---|
540 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
541 | { |
---|
542 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
543 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
544 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
545 | { |
---|
546 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_IFETCH_VAL [x][y])); |
---|
547 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
548 | } |
---|
549 | } |
---|
550 | } |
---|
551 | |
---|
552 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
553 | { |
---|
554 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
555 | if (_param->_have_port_context_id) |
---|
556 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
557 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
558 | { |
---|
559 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_IFETCH_VAL [x][y])); |
---|
560 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
561 | } |
---|
562 | } |
---|
563 | |
---|
564 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
565 | { |
---|
566 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
567 | if (_param->_have_port_context_id) |
---|
568 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
569 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
570 | { |
---|
571 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_IFETCH_VAL [x][y])); |
---|
572 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
573 | } |
---|
574 | } |
---|
575 | |
---|
576 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
577 | { |
---|
578 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
579 | if (_param->_have_port_context_id) |
---|
580 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
581 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_ADDRESS [x])); |
---|
582 | // (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_ADDRESS_NEXT [x])); |
---|
583 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
584 | { |
---|
585 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_VAL [x][y])); |
---|
586 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
587 | } |
---|
588 | } |
---|
589 | |
---|
590 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
591 | { |
---|
592 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
593 | if (_param->_have_port_context_id) |
---|
594 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
595 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_ADDRESS [x])); |
---|
596 | // (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_ADDRESS_NEXT [x])); |
---|
597 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
598 | { |
---|
599 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_VAL [x][y])); |
---|
600 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
601 | } |
---|
602 | } |
---|
603 | |
---|
604 | # endif |
---|
605 | |
---|
606 | } |
---|
607 | #endif |
---|
608 | |
---|
609 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
610 | }; |
---|
611 | |
---|
612 | #undef FUNCTION |
---|
613 | #define FUNCTION "Decod::~Decod" |
---|
614 | Decod::~Decod (void) |
---|
615 | { |
---|
616 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
617 | |
---|
618 | #ifdef STATISTICS |
---|
619 | if (_usage & USE_STATISTICS) |
---|
620 | { |
---|
621 | statistics_deallocation(); |
---|
622 | } |
---|
623 | #endif |
---|
624 | |
---|
625 | log_printf(INFO,Decod,FUNCTION,"Deallocation"); |
---|
626 | deallocation (); |
---|
627 | |
---|
628 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
629 | }; |
---|
630 | |
---|
631 | }; // end namespace decod |
---|
632 | }; // end namespace decod_unit |
---|
633 | }; // end namespace front_end |
---|
634 | }; // end namespace multi_front_end |
---|
635 | }; // end namespace core |
---|
636 | |
---|
637 | }; // end namespace behavioural |
---|
638 | }; // end namespace morpheo |
---|