1 | #ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Two_Level_Branch_Predictor_Glue_h |
---|
2 | #define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Two_Level_Branch_Predictor_Glue_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id$ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | #include "systemc.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include <iostream> |
---|
16 | #include "Common/include/ToString.h" |
---|
17 | #include "Common/include/Debug.h" |
---|
18 | |
---|
19 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h" |
---|
20 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h" |
---|
21 | #ifdef STATISTICS |
---|
22 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h" |
---|
23 | #endif |
---|
24 | #ifdef VHDL |
---|
25 | #include "Behavioural/include/Vhdl.h" |
---|
26 | #endif |
---|
27 | #include "Behavioural/include/Component.h" |
---|
28 | |
---|
29 | using namespace std; |
---|
30 | |
---|
31 | namespace morpheo { |
---|
32 | namespace behavioural { |
---|
33 | namespace stage_1_ifetch { |
---|
34 | namespace predictor { |
---|
35 | namespace meta_predictor { |
---|
36 | namespace two_level_branch_predictor { |
---|
37 | namespace two_level_branch_predictor_glue { |
---|
38 | |
---|
39 | |
---|
40 | class Two_Level_Branch_Predictor_Glue |
---|
41 | #if SYSTEMC |
---|
42 | : public sc_module |
---|
43 | #endif |
---|
44 | { |
---|
45 | // -----[ fields ]---------------------------------------------------- |
---|
46 | // Parameters |
---|
47 | protected : const string _name; |
---|
48 | |
---|
49 | protected : const Parameters _param; |
---|
50 | //#ifdef STATISTICS |
---|
51 | //protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
52 | //#endif |
---|
53 | |
---|
54 | #ifdef STATISTICS |
---|
55 | private : Statistics * _stat; |
---|
56 | #endif |
---|
57 | |
---|
58 | public : Component * _component; |
---|
59 | private : Interfaces * _interfaces; |
---|
60 | |
---|
61 | #ifdef SYSTEMC |
---|
62 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
63 | // Interface |
---|
64 | public : SC_CLOCK * in_CLOCK ; |
---|
65 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
66 | |
---|
67 | public : SC_IN (Tcontrol_t) ** in_PREDICT_BHT_ACK ; |
---|
68 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PHT_ACK ; |
---|
69 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
70 | |
---|
71 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ; |
---|
72 | public : SC_IN (Tbht_history_t) ** in_PREDICT_BHT_HISTORY ; |
---|
73 | public : SC_OUT(Taddress_t) ** out_PREDICT_BHT_ADDRESS ; |
---|
74 | public : SC_OUT(Taddress_t) ** out_PREDICT_PHT_ADDRESS ; |
---|
75 | |
---|
76 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_BHT_ACK ; |
---|
77 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PHT_ACK ; |
---|
78 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
79 | |
---|
80 | public : SC_IN (Taddress_t) ** in_BRANCH_COMPLETE_ADDRESS ; |
---|
81 | public : SC_IN (Tbht_history_t) ** in_BRANCH_COMPLETE_BHT_HISTORY; |
---|
82 | public : SC_OUT(Taddress_t) ** out_BRANCH_COMPLETE_BHT_ADDRESS; |
---|
83 | public : SC_OUT(Taddress_t) ** out_BRANCH_COMPLETE_PHT_ADDRESS; |
---|
84 | |
---|
85 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
86 | |
---|
87 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
88 | |
---|
89 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
90 | #endif |
---|
91 | |
---|
92 | // -----[ methods ]--------------------------------------------------- |
---|
93 | |
---|
94 | #ifdef SYSTEMC |
---|
95 | SC_HAS_PROCESS (Two_Level_Branch_Predictor_Glue); |
---|
96 | #endif |
---|
97 | public : Two_Level_Branch_Predictor_Glue ( |
---|
98 | #ifdef SYSTEMC |
---|
99 | sc_module_name name, |
---|
100 | #else |
---|
101 | string name, |
---|
102 | #endif |
---|
103 | #ifdef STATISTICS |
---|
104 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
105 | #endif |
---|
106 | Parameters param ); |
---|
107 | |
---|
108 | public : Two_Level_Branch_Predictor_Glue (Parameters param ); |
---|
109 | public : ~Two_Level_Branch_Predictor_Glue (void); |
---|
110 | |
---|
111 | #ifdef SYSTEMC |
---|
112 | private : void allocation (void); |
---|
113 | private : void deallocation (void); |
---|
114 | |
---|
115 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
116 | public : void transition (void); |
---|
117 | #endif |
---|
118 | public : void genMealy_predict_ack (void); |
---|
119 | public : void genMealy_predict_bht_address (void); |
---|
120 | public : void genMealy_predict_pht_address (void); |
---|
121 | public : void genMealy_branch_complete_ack (void); |
---|
122 | public : void genMealy_branch_complete_bht_address (void); |
---|
123 | public : void genMealy_branch_complete_pht_address (void); |
---|
124 | #endif |
---|
125 | |
---|
126 | #ifdef STATISTICS |
---|
127 | public : string statistics (uint32_t depth); |
---|
128 | #endif |
---|
129 | #if VHDL |
---|
130 | public : void vhdl (void); |
---|
131 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
132 | private : void vhdl_body (Vhdl * & vhdl); |
---|
133 | #endif |
---|
134 | #ifdef VHDL_TESTBENCH |
---|
135 | private : void vhdl_testbench_transition (void); |
---|
136 | #endif |
---|
137 | }; |
---|
138 | |
---|
139 | }; // end namespace two_level_branch_predictor_glue |
---|
140 | }; // end namespace two_level_branch_predictor |
---|
141 | }; // end namespace meta_predictor |
---|
142 | }; // end namespace predictor |
---|
143 | }; // end namespace stage_1_ifetch |
---|
144 | |
---|
145 | }; // end namespace behavioural |
---|
146 | }; // end namespace morpheo |
---|
147 | |
---|
148 | #endif |
---|