1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_pht_address.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/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h" |
---|
10 | #include "Common/include/BitManipulation.h" |
---|
11 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace core { |
---|
15 | namespace multi_front_end { |
---|
16 | namespace front_end { |
---|
17 | namespace prediction_unit { |
---|
18 | namespace direction { |
---|
19 | |
---|
20 | namespace meta_predictor { |
---|
21 | namespace two_level_branch_predictor { |
---|
22 | namespace two_level_branch_predictor_glue { |
---|
23 | |
---|
24 | void Two_Level_Branch_Predictor_Glue::genMealy_branch_complete_pht_address (void) |
---|
25 | { |
---|
26 | log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","Begin"); |
---|
27 | |
---|
28 | if (_param._have_pht) |
---|
29 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
30 | { |
---|
31 | // Address |
---|
32 | Taddress_t address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]); |
---|
33 | Tbht_history_t history = 0; |
---|
34 | |
---|
35 | if (_param._have_bht) |
---|
36 | { |
---|
37 | history = PORT_READ (in_BRANCH_COMPLETE_BHT_HISTORY [i]); |
---|
38 | address = address << _param._pht_size_address_shift; |
---|
39 | } |
---|
40 | |
---|
41 | Taddress_t pht_address = (history ^ address) & gen_mask<Taddress_t>(_param._pht_size_address); |
---|
42 | |
---|
43 | log_printf(TRACE,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","out_BRANCH_COMPLETE_PHT_ADDRESS [%d]= %.8x xor %.8x<<%d = %.8x",i,history,PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]),_param._pht_size_address_shift, pht_address); |
---|
44 | |
---|
45 | PORT_WRITE (out_BRANCH_COMPLETE_PHT_ADDRESS [i], pht_address); |
---|
46 | } |
---|
47 | |
---|
48 | log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","End"); |
---|
49 | }; |
---|
50 | |
---|
51 | }; // end namespace two_level_branch_predictor_glue |
---|
52 | }; // end namespace two_level_branch_predictor |
---|
53 | }; // end namespace meta_predictor |
---|
54 | |
---|
55 | }; // end namespace core |
---|
56 | }; // end namespace multi_front_end |
---|
57 | }; // end namespace front_end |
---|
58 | }; // end namespace prediction_unit |
---|
59 | }; // end namespace direction |
---|
60 | |
---|
61 | }; // end namespace behavioural |
---|
62 | }; // end namespace morpheo |
---|
63 | #endif |
---|