[4] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h" |
---|
| 10 | #include "Include/BitManipulation.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace stage_1_ifetch { |
---|
| 15 | namespace predictor { |
---|
| 16 | namespace meta_predictor { |
---|
| 17 | namespace meta_predictor_glue { |
---|
| 18 | |
---|
| 19 | void Meta_Predictor_Glue::genMealy_branch_complete_history (void) |
---|
| 20 | { |
---|
| 21 | log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","Begin"); |
---|
| 22 | |
---|
| 23 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
| 24 | { |
---|
| 25 | Thistory_t history = PORT_READ(in_BRANCH_COMPLETE_HISTORY [i]); |
---|
| 26 | |
---|
| 27 | if (_param._have_meta_predictor) |
---|
| 28 | { |
---|
| 29 | if (_param._predictor_0_have_bht) |
---|
| 30 | { |
---|
| 31 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], history & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter)); |
---|
| 32 | history >>= _param._predictor_0_bht_size_shifter; |
---|
| 33 | } |
---|
| 34 | if (_param._predictor_0_have_pht) |
---|
| 35 | { |
---|
| 36 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i], history & gen_mask<Tpht_history_t>(_param._predictor_0_pht_size_counter)); |
---|
| 37 | history >>= _param._predictor_0_pht_size_counter; |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | if (_param._predictor_1_have_bht) |
---|
| 41 | { |
---|
| 42 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], history & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter)); |
---|
| 43 | history >>= _param._predictor_1_bht_size_shifter; |
---|
| 44 | } |
---|
| 45 | if (_param._predictor_1_have_pht) |
---|
| 46 | { |
---|
| 47 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], history & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter)); |
---|
| 48 | history >>= _param._predictor_1_pht_size_counter; |
---|
| 49 | } |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | if (_param._predictor_2_have_bht) |
---|
| 53 | { |
---|
| 54 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i], history & gen_mask<Tbht_history_t>(_param._predictor_2_bht_size_shifter)); |
---|
| 55 | history >>= _param._predictor_2_bht_size_shifter; |
---|
| 56 | } |
---|
| 57 | if (_param._predictor_2_have_pht) |
---|
| 58 | { |
---|
| 59 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i], history & gen_mask<Tpht_history_t>(_param._predictor_2_pht_size_counter)); |
---|
| 60 | history >>= _param._predictor_2_pht_size_counter; |
---|
| 61 | } |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","End"); |
---|
| 65 | }; |
---|
| 66 | |
---|
| 67 | }; // end namespace meta_predictor_glue |
---|
| 68 | }; // end namespace meta_predictor |
---|
| 69 | }; // end namespace predictor |
---|
| 70 | }; // end namespace stage_1_ifetch |
---|
| 71 | }; // end namespace behavioural |
---|
| 72 | }; // end namespace morpheo |
---|
| 73 | #endif |
---|