1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_meta_predictor_glue_Meta_Predictor_Glue_h |
---|
2 | #define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_meta_predictor_glue_Meta_Predictor_Glue_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Meta_Predictor_Glue.h 81 2008-04-15 18:40:01Z rosiere $ |
---|
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/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h" |
---|
20 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Types.h" |
---|
21 | #ifdef STATISTICS |
---|
22 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_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 core { |
---|
34 | namespace multi_front_end { |
---|
35 | namespace front_end { |
---|
36 | namespace prediction_unit { |
---|
37 | namespace direction { |
---|
38 | |
---|
39 | namespace meta_predictor { |
---|
40 | namespace meta_predictor_glue { |
---|
41 | |
---|
42 | |
---|
43 | class Meta_Predictor_Glue |
---|
44 | #if SYSTEMC |
---|
45 | : public sc_module |
---|
46 | #endif |
---|
47 | { |
---|
48 | // -----[ fields ]---------------------------------------------------- |
---|
49 | // Parameters |
---|
50 | protected : const string _name; |
---|
51 | |
---|
52 | protected : const Parameters _param; |
---|
53 | //#ifdef STATISTICS |
---|
54 | // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
55 | //#endif |
---|
56 | |
---|
57 | #ifdef STATISTICS |
---|
58 | private : Statistics * _stat; |
---|
59 | #endif |
---|
60 | |
---|
61 | public : Component * _component; |
---|
62 | private : Interfaces * _interfaces; |
---|
63 | |
---|
64 | #ifdef SYSTEMC |
---|
65 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
66 | // Interface |
---|
67 | public : SC_CLOCK * in_CLOCK ; |
---|
68 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
69 | |
---|
70 | // Interface Predict |
---|
71 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PREDICTOR_0_ACK ; |
---|
72 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PREDICTOR_1_ACK ; |
---|
73 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PREDICTOR_2_ACK ; |
---|
74 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
75 | |
---|
76 | public : SC_IN (Tbht_history_t) ** in_PREDICT_PREDICTOR_0_BHT_HISTORY ; |
---|
77 | public : SC_IN (Tpht_history_t) ** in_PREDICT_PREDICTOR_0_PHT_HISTORY ; |
---|
78 | public : SC_IN (Tbht_history_t) ** in_PREDICT_PREDICTOR_1_BHT_HISTORY ; |
---|
79 | public : SC_IN (Tpht_history_t) ** in_PREDICT_PREDICTOR_1_PHT_HISTORY ; |
---|
80 | public : SC_IN (Tbht_history_t) ** in_PREDICT_PREDICTOR_2_BHT_HISTORY ; |
---|
81 | public : SC_IN (Tpht_history_t) ** in_PREDICT_PREDICTOR_2_PHT_HISTORY ; |
---|
82 | public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ; |
---|
83 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ; |
---|
84 | |
---|
85 | // Interface Branch_complete |
---|
86 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_VAL ; |
---|
87 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_VAL ; |
---|
88 | |
---|
89 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_0_ACK ; |
---|
90 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_1_ACK ; |
---|
91 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_2_ACK ; |
---|
92 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
93 | |
---|
94 | public : SC_OUT(Tbht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY; |
---|
95 | public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY; |
---|
96 | public : SC_OUT(Tbht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY; |
---|
97 | public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY; |
---|
98 | public : SC_OUT(Tbht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY; |
---|
99 | public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY; |
---|
100 | public : SC_IN (Thistory_t) ** in_BRANCH_COMPLETE_HISTORY ; |
---|
101 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_DIRECTION ; |
---|
102 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ; |
---|
103 | |
---|
104 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
105 | |
---|
106 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
107 | |
---|
108 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
109 | #endif |
---|
110 | |
---|
111 | // -----[ methods ]--------------------------------------------------- |
---|
112 | |
---|
113 | #ifdef SYSTEMC |
---|
114 | SC_HAS_PROCESS (Meta_Predictor_Glue); |
---|
115 | #endif |
---|
116 | public : Meta_Predictor_Glue ( |
---|
117 | #ifdef SYSTEMC |
---|
118 | sc_module_name name, |
---|
119 | #else |
---|
120 | string name, |
---|
121 | #endif |
---|
122 | #ifdef STATISTICS |
---|
123 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
124 | #endif |
---|
125 | Parameters param ); |
---|
126 | |
---|
127 | public : Meta_Predictor_Glue (Parameters param ); |
---|
128 | public : ~Meta_Predictor_Glue (void); |
---|
129 | |
---|
130 | #ifdef SYSTEMC |
---|
131 | private : void allocation (void); |
---|
132 | private : void deallocation (void); |
---|
133 | |
---|
134 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
135 | public : void transition (void); |
---|
136 | #endif |
---|
137 | public : void genMealy_predict_ack (void); |
---|
138 | public : void genMealy_predict_history (void); |
---|
139 | public : void genMealy_branch_complete_val (void); |
---|
140 | public : void genMealy_branch_complete_ack (void); |
---|
141 | public : void genMealy_branch_complete_history (void); |
---|
142 | |
---|
143 | #endif |
---|
144 | #ifdef STATISTICS |
---|
145 | public : string statistics (uint32_t depth); |
---|
146 | #endif |
---|
147 | |
---|
148 | #if VHDL |
---|
149 | public : void vhdl (void); |
---|
150 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
151 | private : void vhdl_body (Vhdl * & vhdl); |
---|
152 | #endif |
---|
153 | #ifdef VHDL_TESTBENCH |
---|
154 | private : void vhdl_testbench_transition (void); |
---|
155 | #endif |
---|
156 | }; |
---|
157 | |
---|
158 | }; // end namespace meta_predictor_glue |
---|
159 | }; // end namespace meta_predictor |
---|
160 | |
---|
161 | }; // end namespace core |
---|
162 | }; // end namespace multi_front_end |
---|
163 | }; // end namespace front_end |
---|
164 | }; // end namespace prediction_unit |
---|
165 | }; // end namespace direction |
---|
166 | |
---|
167 | |
---|
168 | }; // end namespace behavioural |
---|
169 | }; // end namespace morpheo |
---|
170 | |
---|
171 | #endif |
---|