1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_Direction_h |
---|
2 | #define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_Direction_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Direction.h 112 2009-03-18 22:36:26Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | #include "systemc.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/include/Direction_Glue.h" |
---|
16 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Meta_Predictor.h" |
---|
17 | #include <iostream> |
---|
18 | #include "Common/include/ToString.h" |
---|
19 | #include "Common/include/Debug.h" |
---|
20 | #include "Behavioural/include/Types.h" |
---|
21 | |
---|
22 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/include/Parameters.h" |
---|
23 | #ifdef STATISTICS |
---|
24 | #include "Behavioural/include/Stat.h" |
---|
25 | #endif |
---|
26 | #include "Behavioural/include/Component.h" |
---|
27 | #ifdef VHDL |
---|
28 | #include "Behavioural/include/Vhdl.h" |
---|
29 | #endif |
---|
30 | #include "Behavioural/include/Usage.h" |
---|
31 | |
---|
32 | namespace morpheo { |
---|
33 | namespace behavioural { |
---|
34 | namespace core { |
---|
35 | namespace multi_front_end { |
---|
36 | namespace front_end { |
---|
37 | namespace prediction_unit { |
---|
38 | namespace direction { |
---|
39 | |
---|
40 | class Direction |
---|
41 | #if SYSTEMC |
---|
42 | : public sc_module |
---|
43 | #endif |
---|
44 | { |
---|
45 | // -----[ fields ]---------------------------------------------------- |
---|
46 | // Parameters |
---|
47 | protected : const std::string _name; |
---|
48 | protected : const Parameters * _param; |
---|
49 | private : const Tusage_t _usage; |
---|
50 | |
---|
51 | #ifdef STATISTICS |
---|
52 | public : Stat * _stat; |
---|
53 | #endif |
---|
54 | |
---|
55 | public : Component * _component; |
---|
56 | private : Interfaces * _interfaces; |
---|
57 | |
---|
58 | #ifdef SYSTEMC |
---|
59 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
60 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
61 | public : SC_CLOCK * in_CLOCK ; |
---|
62 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
63 | |
---|
64 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
65 | public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ; |
---|
66 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
67 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS_SRC ; |
---|
68 | public : SC_IN (Tcontrol_t) ** in_PREDICT_STATIC ; |
---|
69 | public : SC_IN (Tcontrol_t) ** in_PREDICT_LAST_TAKE ; |
---|
70 | public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ; |
---|
71 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ; |
---|
72 | |
---|
73 | // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
74 | public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ; |
---|
75 | public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ; |
---|
76 | public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ; |
---|
77 | public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ; |
---|
78 | public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ; |
---|
79 | public : SC_IN (Tcontrol_t) ** in_UPDATE_PREDICTION_IFETCH; |
---|
80 | |
---|
81 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
82 | public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Meta_Predictor * _component_meta_predictor; |
---|
83 | public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Direction_Glue * _component_glue; |
---|
84 | |
---|
85 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
86 | |
---|
87 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
88 | #endif |
---|
89 | |
---|
90 | // -----[ Methods ]--------------------------------------------------- |
---|
91 | |
---|
92 | #ifdef SYSTEMC |
---|
93 | SC_HAS_PROCESS (Direction); |
---|
94 | #endif |
---|
95 | public : Direction |
---|
96 | ( |
---|
97 | #ifdef SYSTEMC |
---|
98 | sc_module_name name, |
---|
99 | #else |
---|
100 | std::string name, |
---|
101 | #endif |
---|
102 | #ifdef STATISTICS |
---|
103 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
104 | #endif |
---|
105 | Parameters * param, |
---|
106 | morpheo::behavioural::Tusage_t usage |
---|
107 | ); |
---|
108 | public : ~Direction (void); |
---|
109 | |
---|
110 | private : void allocation ( |
---|
111 | #ifdef STATISTICS |
---|
112 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
113 | #else |
---|
114 | void |
---|
115 | #endif |
---|
116 | ); |
---|
117 | private : void deallocation (void); |
---|
118 | |
---|
119 | #ifdef SYSTEMC |
---|
120 | # if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
121 | public : void transition (void); |
---|
122 | # endif |
---|
123 | #endif |
---|
124 | |
---|
125 | #if VHDL |
---|
126 | public : void vhdl (void); |
---|
127 | #endif |
---|
128 | |
---|
129 | #ifdef STATISTICS |
---|
130 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
131 | public : void statistics_deallocation (void); |
---|
132 | #endif |
---|
133 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
134 | private : void end_cycle (void); |
---|
135 | #endif |
---|
136 | }; |
---|
137 | |
---|
138 | }; // end namespace direction |
---|
139 | }; // end namespace prediction_unit |
---|
140 | }; // end namespace front_end |
---|
141 | }; // end namespace multi_front_end |
---|
142 | }; // end namespace core |
---|
143 | |
---|
144 | }; // end namespace behavioural |
---|
145 | }; // end namespace morpheo |
---|
146 | |
---|
147 | #endif |
---|