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 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], (history >> _param._shift_0) & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter)); |
---|
31 | if (_param._predictor_0_have_pht) |
---|
32 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i], (history >> _param._shift_1) & gen_mask<Tpht_history_t>(_param._predictor_0_pht_size_counter)); |
---|
33 | } |
---|
34 | |
---|
35 | if (_param._predictor_1_have_bht) |
---|
36 | { |
---|
37 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], (history >> _param._shift_2) & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter)); |
---|
38 | |
---|
39 | if (_param._predictor_1_have_pht) |
---|
40 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], (history >> _param._shift_3) & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter)); |
---|
41 | } |
---|
42 | |
---|
43 | if (_param._predictor_2_have_bht) |
---|
44 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i], (history >> _param._shift_4) & gen_mask<Tbht_history_t>(_param._predictor_2_bht_size_shifter)); |
---|
45 | if (_param._predictor_2_have_pht) |
---|
46 | PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i], (history >> _param._shift_5) & gen_mask<Tpht_history_t>(_param._predictor_2_pht_size_counter)); |
---|
47 | } |
---|
48 | |
---|
49 | log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","End"); |
---|
50 | }; |
---|
51 | |
---|
52 | }; // end namespace meta_predictor_glue |
---|
53 | }; // end namespace meta_predictor |
---|
54 | }; // end namespace predictor |
---|
55 | }; // end namespace stage_1_ifetch |
---|
56 | }; // end namespace behavioural |
---|
57 | }; // end namespace morpheo |
---|
58 | #endif |
---|