1 | #ifdef VHDL |
---|
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 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace stage_1_ifetch { |
---|
14 | namespace predictor { |
---|
15 | namespace meta_predictor { |
---|
16 | namespace meta_predictor_glue { |
---|
17 | |
---|
18 | |
---|
19 | void Meta_Predictor_Glue::vhdl_declaration (Vhdl & vhdl) |
---|
20 | { |
---|
21 | log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","Begin"); |
---|
22 | |
---|
23 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
24 | { |
---|
25 | if (_param._have_meta_predictor) |
---|
26 | { |
---|
27 | if (_param._predictor_0_have_pht) |
---|
28 | vhdl.set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1)); |
---|
29 | else |
---|
30 | vhdl.set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1)); |
---|
31 | if (_param._predictor_1_have_pht) |
---|
32 | vhdl.set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1)); |
---|
33 | else |
---|
34 | vhdl.set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1)); |
---|
35 | } |
---|
36 | |
---|
37 | if (_param._predictor_2_have_pht) |
---|
38 | vhdl.set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1)); |
---|
39 | else |
---|
40 | vhdl.set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1)); |
---|
41 | } |
---|
42 | |
---|
43 | if (_param._have_meta_predictor) |
---|
44 | { |
---|
45 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
46 | { |
---|
47 | // if (_param._predictor_2_have_pht) |
---|
48 | // vhdl.set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_6-1, _param._shift_6-1)); |
---|
49 | // else |
---|
50 | // vhdl.set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_5-1, _param._shift_5-1)); |
---|
51 | |
---|
52 | if (_param._predictor_1_have_pht) |
---|
53 | vhdl.set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_4-1, _param._shift_4-1)); |
---|
54 | else |
---|
55 | vhdl.set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_3-1, _param._shift_3-1)); |
---|
56 | |
---|
57 | if (_param._predictor_0_have_pht) |
---|
58 | vhdl.set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_2-1, _param._shift_2-1)); |
---|
59 | else |
---|
60 | vhdl.set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_1-1, _param._shift_1-1)); |
---|
61 | |
---|
62 | } |
---|
63 | } |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","End"); |
---|
68 | }; |
---|
69 | |
---|
70 | }; // end namespace meta_predictor_glue |
---|
71 | }; // end namespace meta_predictor |
---|
72 | }; // end namespace predictor |
---|
73 | }; // end namespace stage_1_ifetch |
---|
74 | |
---|
75 | }; // end namespace behavioural |
---|
76 | }; // end namespace morpheo |
---|
77 | #endif |
---|