1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Direction_Glue_genMealy_predict.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/include/Direction_Glue.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace prediction_unit { |
---|
17 | namespace direction { |
---|
18 | namespace direction_glue { |
---|
19 | |
---|
20 | |
---|
21 | #undef FUNCTION |
---|
22 | #define FUNCTION "Direction_Glue::genMealy_predict" |
---|
23 | void Direction_Glue::genMealy_predict (void) |
---|
24 | { |
---|
25 | log_printf(FUNC,Direction_Glue,FUNCTION,"Begin"); |
---|
26 | |
---|
27 | // constant direction : never / always |
---|
28 | switch (_param->_predictor_scheme) |
---|
29 | { |
---|
30 | case PREDICTOR_STATIC : |
---|
31 | { |
---|
32 | for (uint32_t i=0; i<_param->_nb_inst_predict; i++) |
---|
33 | PORT_WRITE(out_PREDICT_DIRECTION [i], PORT_READ(in_PREDICT_STATIC [i])); |
---|
34 | |
---|
35 | break; |
---|
36 | } |
---|
37 | case PREDICTOR_LAST_TAKE : |
---|
38 | { |
---|
39 | for (uint32_t i=0; i<_param->_nb_inst_predict; i++) |
---|
40 | PORT_WRITE(out_PREDICT_DIRECTION [i], PORT_READ(in_PREDICT_LAST_TAKE [i])); |
---|
41 | |
---|
42 | break; |
---|
43 | } |
---|
44 | case PREDICTOR_COUNTER : |
---|
45 | case PREDICTOR_LOCAL : |
---|
46 | case PREDICTOR_GLOBAL : |
---|
47 | case PREDICTOR_META : |
---|
48 | case PREDICTOR_CUSTOM : |
---|
49 | { |
---|
50 | for (uint32_t i=0; i<_param->_nb_inst_predict; i++) |
---|
51 | { |
---|
52 | // not use : |
---|
53 | // in_PREDICT_LAST_TAKE |
---|
54 | // in_PREDICT_STATIC |
---|
55 | |
---|
56 | PORT_WRITE(out_PREDICT_PREDICTOR_VAL [i], PORT_READ(in_PREDICT_VAL [i])); |
---|
57 | PORT_WRITE(out_PREDICT_ACK [i], PORT_READ(in_PREDICT_PREDICTOR_ACK [i])); |
---|
58 | PORT_WRITE(out_PREDICT_PREDICTOR_ADDRESS_SRC [i], PORT_READ(in_PREDICT_ADDRESS_SRC [i])); |
---|
59 | PORT_WRITE(out_PREDICT_HISTORY [i], PORT_READ(in_PREDICT_PREDICTOR_HISTORY [i])); |
---|
60 | PORT_WRITE(out_PREDICT_DIRECTION [i], PORT_READ(in_PREDICT_PREDICTOR_DIRECTION [i])); |
---|
61 | } |
---|
62 | |
---|
63 | break; |
---|
64 | } |
---|
65 | default : |
---|
66 | { |
---|
67 | ERRORMORPHEO(FUNCTION,"No valid predictor scheme"); |
---|
68 | break; |
---|
69 | } |
---|
70 | } |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | log_printf(FUNC,Direction_Glue,FUNCTION,"End"); |
---|
75 | }; |
---|
76 | |
---|
77 | }; // end namespace direction_glue |
---|
78 | }; // end namespace direction |
---|
79 | }; // end namespace prediction_unit |
---|
80 | }; // end namespace front_end |
---|
81 | }; // end namespace multi_front_end |
---|
82 | }; // end namespace core |
---|
83 | }; // end namespace behavioural |
---|
84 | }; // end namespace morpheo |
---|
85 | #endif |
---|