[2] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace stage_1_ifetch { |
---|
| 14 | namespace predictor { |
---|
| 15 | namespace meta_predictor { |
---|
| 16 | namespace two_level_branch_predictor { |
---|
| 17 | namespace two_level_branch_predictor_glue { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | void Two_Level_Branch_Predictor_Glue::allocation (void) |
---|
| 21 | { |
---|
| 22 | string rename; |
---|
| 23 | |
---|
| 24 | log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","Begin"); |
---|
| 25 | |
---|
| 26 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 27 | in_CLOCK = new SC_CLOCK ("in_CLOCK"); |
---|
| 28 | #endif |
---|
| 29 | |
---|
| 30 | if (_param._have_bht) |
---|
| 31 | { |
---|
| 32 | in_PREDICT_BHT_ACK = new SC_IN (Tcontrol_t) * [_param._nb_prediction]; |
---|
| 33 | out_PREDICT_BHT_ADDRESS = new SC_OUT(Taddress_t) * [_param._nb_prediction]; |
---|
| 34 | } |
---|
| 35 | if (_param._have_pht) |
---|
| 36 | { |
---|
| 37 | in_PREDICT_PHT_ACK = new SC_IN (Tcontrol_t) * [_param._nb_prediction]; |
---|
| 38 | out_PREDICT_PHT_ADDRESS = new SC_OUT(Taddress_t) * [_param._nb_prediction]; |
---|
| 39 | } |
---|
| 40 | if (_param._have_bht and _param._have_pht) |
---|
| 41 | in_PREDICT_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_prediction]; |
---|
| 42 | out_PREDICT_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_prediction]; |
---|
| 43 | in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction]; |
---|
| 44 | |
---|
| 45 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
| 46 | { |
---|
| 47 | if (_param._have_bht) |
---|
| 48 | { |
---|
| 49 | rename = " in_PREDICT_BHT_ACK_" +toString(i); |
---|
| 50 | in_PREDICT_BHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
| 51 | |
---|
| 52 | rename = "out_PREDICT_BHT_ADDRESS_"+toString(i); |
---|
| 53 | out_PREDICT_BHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); |
---|
| 54 | } |
---|
| 55 | if (_param._have_pht) |
---|
| 56 | { |
---|
| 57 | rename = " in_PREDICT_PHT_ACK_" +toString(i); |
---|
| 58 | in_PREDICT_PHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
| 59 | |
---|
| 60 | rename = "out_PREDICT_PHT_ADDRESS_"+toString(i); |
---|
| 61 | out_PREDICT_PHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); |
---|
| 62 | } |
---|
| 63 | if (_param._have_bht and _param._have_pht) |
---|
| 64 | { |
---|
| 65 | rename = " in_PREDICT_BHT_HISTORY_"+toString(i); |
---|
| 66 | in_PREDICT_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); |
---|
| 67 | } |
---|
| 68 | rename = "out_PREDICT_ACK_" +toString(i); |
---|
| 69 | out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
| 70 | |
---|
| 71 | rename = " in_PREDICT_ADDRESS_" +toString(i); |
---|
| 72 | in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | if (_param._have_bht) |
---|
| 76 | { |
---|
| 77 | in_BRANCH_COMPLETE_BHT_ACK = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; |
---|
| 78 | out_BRANCH_COMPLETE_BHT_ADDRESS = new SC_OUT(Taddress_t) * [_param._nb_branch_complete]; |
---|
| 79 | } |
---|
| 80 | if (_param._have_pht) |
---|
| 81 | { |
---|
| 82 | in_BRANCH_COMPLETE_PHT_ACK = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; |
---|
| 83 | out_BRANCH_COMPLETE_PHT_ADDRESS = new SC_OUT(Taddress_t) * [_param._nb_branch_complete]; |
---|
| 84 | } |
---|
| 85 | if (_param._have_bht and _param._have_pht) |
---|
| 86 | in_BRANCH_COMPLETE_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_branch_complete]; |
---|
| 87 | |
---|
| 88 | out_BRANCH_COMPLETE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete]; |
---|
| 89 | in_BRANCH_COMPLETE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_branch_complete]; |
---|
| 90 | |
---|
| 91 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
| 92 | { |
---|
| 93 | if (_param._have_bht) |
---|
| 94 | { |
---|
| 95 | rename = " in_BRANCH_COMPLETE_BHT_ACK_" +toString(i); |
---|
| 96 | in_BRANCH_COMPLETE_BHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
| 97 | |
---|
| 98 | rename = "out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i); |
---|
| 99 | out_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); |
---|
| 100 | } |
---|
| 101 | if (_param._have_pht) |
---|
| 102 | { |
---|
| 103 | rename = " in_BRANCH_COMPLETE_PHT_ACK_" +toString(i); |
---|
| 104 | in_BRANCH_COMPLETE_PHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
| 105 | |
---|
| 106 | rename = "out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i); |
---|
| 107 | out_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); |
---|
| 108 | } |
---|
| 109 | if (_param._have_bht and _param._have_pht) |
---|
| 110 | { |
---|
| 111 | rename = " in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i); |
---|
| 112 | in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); |
---|
| 113 | } |
---|
| 114 | rename = "out_BRANCH_COMPLETE_ACK_" +toString(i); |
---|
| 115 | out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
| 116 | |
---|
| 117 | rename = " in_BRANCH_COMPLETE_ADDRESS_" +toString(i); |
---|
| 118 | in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 122 | |
---|
| 123 | log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","End"); |
---|
| 124 | }; |
---|
| 125 | |
---|
| 126 | }; // end namespace two_level_branch_predictor_glue |
---|
| 127 | }; // end namespace two_level_branch_predictor |
---|
| 128 | }; // end namespace meta_predictor |
---|
| 129 | }; // end namespace predictor |
---|
| 130 | }; // end namespace stage_1_ifetch |
---|
| 131 | |
---|
| 132 | }; // end namespace behavioural |
---|
| 133 | }; // end namespace morpheo |
---|
| 134 | #endif |
---|