[78] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Direction_Glue_genMealy_predict.cpp 107 2009-02-10 23:03:25Z 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 | { |
---|
[107] | 25 | log_begin(Direction_Glue,FUNCTION); |
---|
| 26 | log_function(Direction_Glue,FUNCTION,_name.c_str()); |
---|
[78] | 27 | |
---|
| 28 | // constant direction : never / always |
---|
[107] | 29 | for (uint32_t i=0; i<_param->_nb_inst_predict; i++) |
---|
[78] | 30 | { |
---|
[107] | 31 | log_printf(TRACE,Direction_Glue,FUNCTION," * PREDICT [%d]",i); |
---|
[78] | 32 | |
---|
[107] | 33 | Tcontrol_t direction; |
---|
[78] | 34 | |
---|
[107] | 35 | switch (_param->_predictor_scheme) |
---|
| 36 | { |
---|
| 37 | // defined as constant in Direction_Glue.cpp |
---|
| 38 | // case PREDICTOR_NEVER_TAKE : |
---|
| 39 | // { |
---|
| 40 | // direction = 0; |
---|
| 41 | // break; |
---|
| 42 | // } |
---|
| 43 | // case PREDICTOR_ALWAYS_TAKE : |
---|
| 44 | // { |
---|
| 45 | // direction = 1; |
---|
| 46 | // break; |
---|
| 47 | // } |
---|
| 48 | case PREDICTOR_STATIC : |
---|
| 49 | { |
---|
| 50 | direction = PORT_READ(in_PREDICT_STATIC [i]); |
---|
| 51 | break; |
---|
| 52 | } |
---|
| 53 | case PREDICTOR_LAST_TAKE : |
---|
| 54 | { |
---|
| 55 | direction = PORT_READ(in_PREDICT_LAST_TAKE [i]); |
---|
| 56 | break; |
---|
| 57 | } |
---|
| 58 | case PREDICTOR_COUNTER : |
---|
| 59 | case PREDICTOR_LOCAL : |
---|
| 60 | case PREDICTOR_GLOBAL : |
---|
| 61 | case PREDICTOR_META : |
---|
| 62 | case PREDICTOR_CUSTOM : |
---|
| 63 | { |
---|
| 64 | // not use : |
---|
| 65 | // in_PREDICT_LAST_TAKE |
---|
| 66 | // in_PREDICT_STATIC |
---|
| 67 | |
---|
| 68 | direction = PORT_READ(in_PREDICT_PREDICTOR_DIRECTION [i]); |
---|
| 69 | |
---|
[78] | 70 | PORT_WRITE(out_PREDICT_PREDICTOR_VAL [i], PORT_READ(in_PREDICT_VAL [i])); |
---|
| 71 | PORT_WRITE(out_PREDICT_ACK [i], PORT_READ(in_PREDICT_PREDICTOR_ACK [i])); |
---|
| 72 | PORT_WRITE(out_PREDICT_PREDICTOR_ADDRESS_SRC [i], PORT_READ(in_PREDICT_ADDRESS_SRC [i])); |
---|
| 73 | PORT_WRITE(out_PREDICT_HISTORY [i], PORT_READ(in_PREDICT_PREDICTOR_HISTORY [i])); |
---|
[107] | 74 | |
---|
| 75 | break; |
---|
| 76 | } |
---|
| 77 | default : |
---|
| 78 | { |
---|
| 79 | ERRORMORPHEO(FUNCTION,"No valid predictor scheme"); |
---|
| 80 | break; |
---|
| 81 | } |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | log_printf(TRACE,Direction_Glue,FUNCTION," * direction : %d",direction); |
---|
[78] | 85 | |
---|
[107] | 86 | PORT_WRITE(out_PREDICT_DIRECTION [i], direction); |
---|
[78] | 87 | } |
---|
| 88 | |
---|
[107] | 89 | log_end(Direction_Glue,FUNCTION); |
---|
[78] | 90 | }; |
---|
| 91 | |
---|
| 92 | }; // end namespace direction_glue |
---|
| 93 | }; // end namespace direction |
---|
| 94 | }; // end namespace prediction_unit |
---|
| 95 | }; // end namespace front_end |
---|
| 96 | }; // end namespace multi_front_end |
---|
| 97 | }; // end namespace core |
---|
| 98 | }; // end namespace behavioural |
---|
| 99 | }; // end namespace morpheo |
---|
| 100 | #endif |
---|