1 | #ifdef VHDL |
---|
2 | /* |
---|
3 | * $Id$ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.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 | |
---|
18 | |
---|
19 | void Two_Level_Branch_Predictor::vhdl_port (Vhdl & vhdl) |
---|
20 | { |
---|
21 | log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_port","Begin"); |
---|
22 | |
---|
23 | vhdl.set_port (" in_CLOCK" , IN, 1); |
---|
24 | |
---|
25 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
26 | { |
---|
27 | vhdl.set_port (" in_PREDICT_VAL_" +toString(i), IN, 1); |
---|
28 | vhdl.set_port ("out_PREDICT_ACK_" +toString(i),OUT, 1); |
---|
29 | vhdl.set_port (" in_PREDICT_ADDRESS_" +toString(i), IN,_param._size_address); |
---|
30 | if (_param._have_bht) |
---|
31 | vhdl.set_port ("out_PREDICT_BHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter)))); |
---|
32 | if (_param._have_pht) |
---|
33 | vhdl.set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter)))); |
---|
34 | } |
---|
35 | |
---|
36 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
37 | { |
---|
38 | vhdl.set_port (" in_BRANCH_COMPLETE_VAL_" +toString(i), IN, 1); |
---|
39 | vhdl.set_port ("out_BRANCH_COMPLETE_ACK_" +toString(i),OUT, 1); |
---|
40 | vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_" +toString(i), IN,_param._size_address); |
---|
41 | if (_param._have_bht) |
---|
42 | vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter)))); |
---|
43 | if (_param._have_bht) |
---|
44 | vhdl.set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter)))); |
---|
45 | vhdl.set_port (" in_BRANCH_COMPLETE_HIT_" +toString(i), IN, 1); |
---|
46 | } |
---|
47 | |
---|
48 | log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_port","End"); |
---|
49 | }; |
---|
50 | |
---|
51 | }; // end namespace two_level_branch_predictor |
---|
52 | }; // end namespace meta_predictor |
---|
53 | }; // end namespace predictor |
---|
54 | }; // end namespace stage_1_ifetch |
---|
55 | }; // end namespace behavioural |
---|
56 | }; // end namespace morpheo |
---|
57 | #endif |
---|