1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_front_end_glue_Front_end_Glue_h |
---|
2 | #define morpheo_behavioural_core_multi_front_end_front_end_front_end_glue_Front_end_Glue_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Front_end_Glue.h 101 2009-01-15 17:19:08Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | #include "systemc.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | |
---|
16 | #include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Parameters.h" |
---|
17 | #include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Types.h" |
---|
18 | #ifdef STATISTICS |
---|
19 | #include "Behavioural/include/Stat.h" |
---|
20 | #endif |
---|
21 | #include "Behavioural/include/Component.h" |
---|
22 | #ifdef VHDL |
---|
23 | #include "Behavioural/include/Vhdl.h" |
---|
24 | #endif |
---|
25 | #include "Behavioural/include/Usage.h" |
---|
26 | |
---|
27 | #include "Common/include/ToString.h" |
---|
28 | #include "Common/include/Debug.h" |
---|
29 | |
---|
30 | #include <iostream> |
---|
31 | |
---|
32 | namespace morpheo { |
---|
33 | namespace behavioural { |
---|
34 | |
---|
35 | namespace core { |
---|
36 | namespace multi_front_end { |
---|
37 | namespace front_end { |
---|
38 | namespace front_end_glue { |
---|
39 | |
---|
40 | |
---|
41 | class Front_end_Glue |
---|
42 | #if SYSTEMC |
---|
43 | : public sc_module |
---|
44 | #endif |
---|
45 | { |
---|
46 | // -----[ fields ]---------------------------------------------------- |
---|
47 | // Parameters |
---|
48 | protected : const std::string _name; |
---|
49 | protected : const Parameters * _param; |
---|
50 | private : const Tusage_t _usage; |
---|
51 | |
---|
52 | #ifdef STATISTICS |
---|
53 | public : Stat * _stat; |
---|
54 | #endif |
---|
55 | |
---|
56 | public : Component * _component; |
---|
57 | private : Interfaces * _interfaces; |
---|
58 | |
---|
59 | #ifdef SYSTEMC |
---|
60 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
61 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
62 | public : SC_CLOCK * in_CLOCK ; |
---|
63 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
64 | |
---|
65 | // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
66 | public : SC_OUT(Tcontext_t ) *** out_IFETCH_DECOD_UNIT_CONTEXT_ID ;//[nb_decod_unit][nb_decod_unit_context] |
---|
67 | |
---|
68 | // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
69 | public : SC_OUT(Tcontext_t ) *** out_DECOD_CONTEXT_ID ;//[nb_decod_unit][nb_inst_decod] |
---|
70 | public : SC_IN (Tcontext_t ) *** in_DECOD_DECOD_UNIT_CONTEXT_ID ;//[nb_decod_unit][nb_inst_decod] |
---|
71 | |
---|
72 | // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
73 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_VAL ;//[nb_inst_branch_complete] |
---|
74 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_ACK ;//[nb_inst_branch_complete] |
---|
75 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_MISS_PREDICTION ;//[nb_inst_branch_complete] |
---|
76 | |
---|
77 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL ;//[nb_inst_branch_complete] |
---|
78 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK ;//[nb_inst_branch_complete] |
---|
79 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION ;//[nb_inst_branch_complete] |
---|
80 | |
---|
81 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_CONTEXT_STATE_VAL ;//[nb_inst_branch_complete] |
---|
82 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_CONTEXT_STATE_ACK ;//[nb_inst_branch_complete] |
---|
83 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION ;//[nb_inst_branch_complete] |
---|
84 | |
---|
85 | // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
86 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_VAL ;//[nb_context] |
---|
87 | public : SC_IN (Tcontrol_t ) ** in_EVENT_ACK ;//[nb_context] |
---|
88 | public : SC_OUT(Taddress_t ) ** out_EVENT_ADDRESS ;//[nb_context] |
---|
89 | public : SC_OUT(Taddress_t ) ** out_EVENT_ADDRESS_NEXT ;//[nb_context] |
---|
90 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_ADDRESS_NEXT_VAL ;//[nb_context] |
---|
91 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IS_DS_TAKE ;//[nb_context] |
---|
92 | |
---|
93 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IFETCH_UNIT_VAL ;//[nb_context] |
---|
94 | public : SC_IN (Tcontrol_t ) ** in_EVENT_IFETCH_UNIT_ACK ;//[nb_context] |
---|
95 | public : SC_OUT(Taddress_t ) ** out_EVENT_IFETCH_UNIT_ADDRESS ;//[nb_context] |
---|
96 | public : SC_OUT(Taddress_t ) ** out_EVENT_IFETCH_UNIT_ADDRESS_NEXT ;//[nb_context] |
---|
97 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL ;//[nb_context] |
---|
98 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IFETCH_UNIT_IS_DS_TAKE ;//[nb_context] |
---|
99 | |
---|
100 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_PREDICTION_UNIT_VAL ;//[nb_context] |
---|
101 | public : SC_IN (Tcontrol_t ) ** in_EVENT_PREDICTION_UNIT_ACK ;//[nb_context] |
---|
102 | public : SC_OUT(Tevent_type_t ) ** out_EVENT_PREDICTION_UNIT_TYPE ;//[nb_context] |
---|
103 | public : SC_OUT(Tdepth_t ) ** out_EVENT_PREDICTION_UNIT_DEPTH ;//[nb_context] |
---|
104 | |
---|
105 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_VAL ;//[nb_context] |
---|
106 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_CONTEXT_STATE_ACK ;//[nb_context] |
---|
107 | public : SC_IN (Taddress_t ) ** in_EVENT_CONTEXT_STATE_ADDRESS ;//[nb_context] |
---|
108 | public : SC_IN (Taddress_t ) ** in_EVENT_CONTEXT_STATE_ADDRESS_NEXT ;//[nb_context] |
---|
109 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL ;//[nb_context] |
---|
110 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_IS_DS_TAKE ;//[nb_context] |
---|
111 | public : SC_IN (Tevent_type_t ) ** in_EVENT_CONTEXT_STATE_TYPE ;//[nb_context] |
---|
112 | public : SC_IN (Tdepth_t ) ** in_EVENT_CONTEXT_STATE_DEPTH ;//[nb_context] |
---|
113 | |
---|
114 | // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
115 | public : SC_OUT(Tdepth_t ) ** out_DEPTH_MIN ;//[nb_context] |
---|
116 | public : SC_OUT(Tdepth_t ) ** out_DEPTH_MAX ;//[nb_context] |
---|
117 | public : SC_OUT(Tcontrol_t ) ** out_DEPTH_FULL ;//[nb_context] |
---|
118 | |
---|
119 | public : SC_IN (Tcontrol_t ) ** in_DEPTH_PREDICTION_UNIT_VAL ;//[nb_context] |
---|
120 | public : SC_IN (Tdepth_t ) ** in_DEPTH_PREDICTION_UNIT_CURRENT ;//[nb_context] |
---|
121 | public : SC_IN (Tdepth_t ) ** in_DEPTH_PREDICTION_UNIT_MIN ;//[nb_context] |
---|
122 | public : SC_IN (Tdepth_t ) ** in_DEPTH_PREDICTION_UNIT_MAX ;//[nb_context] |
---|
123 | public : SC_IN (Tcontrol_t ) ** in_DEPTH_PREDICTION_UNIT_FULL ;//[nb_context] |
---|
124 | |
---|
125 | //public : SC_OUT(Tdepth_t ) *** out_DEPTH_DECOD_UNIT_CURRENT ;//[nb_decod_unit][nb_decod_unit_context] |
---|
126 | public : SC_OUT(Tdepth_t ) *** out_DEPTH_DECOD_UNIT_MIN ;//[nb_decod_unit][nb_decod_unit_context] |
---|
127 | public : SC_OUT(Tdepth_t ) *** out_DEPTH_DECOD_UNIT_MAX ;//[nb_decod_unit][nb_decod_unit_context] |
---|
128 | public : SC_OUT(Tcontrol_t ) *** out_DEPTH_DECOD_UNIT_FULL ;//[nb_decod_unit][nb_decod_unit_context] |
---|
129 | |
---|
130 | public : SC_OUT(Tdepth_t ) ** out_DEPTH_CONTEXT_STATE_MIN ;//[nb_context] |
---|
131 | |
---|
132 | // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
133 | public : SC_OUT(Tcontrol_t ) *** out_CONTEXT_DECOD_UNIT_DEPTH_VAL ;//[nb_decod_unit][nb_decod_unit_context] |
---|
134 | public : SC_OUT(Tdepth_t ) *** out_CONTEXT_DECOD_UNIT_DEPTH ;//[nb_decod_unit][nb_decod_unit_context] |
---|
135 | |
---|
136 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
137 | |
---|
138 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
139 | |
---|
140 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
141 | #endif |
---|
142 | |
---|
143 | // -----[ Methods ]--------------------------------------------------- |
---|
144 | |
---|
145 | #ifdef SYSTEMC |
---|
146 | SC_HAS_PROCESS (Front_end_Glue); |
---|
147 | #endif |
---|
148 | public : Front_end_Glue |
---|
149 | ( |
---|
150 | #ifdef SYSTEMC |
---|
151 | sc_module_name name, |
---|
152 | #else |
---|
153 | std::string name, |
---|
154 | #endif |
---|
155 | #ifdef STATISTICS |
---|
156 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
157 | #endif |
---|
158 | Parameters * param, |
---|
159 | morpheo::behavioural::Tusage_t usage |
---|
160 | ); |
---|
161 | public : ~Front_end_Glue (void); |
---|
162 | |
---|
163 | private : void allocation ( |
---|
164 | #ifdef STATISTICS |
---|
165 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
166 | #else |
---|
167 | void |
---|
168 | #endif |
---|
169 | ); |
---|
170 | private : void deallocation (void); |
---|
171 | |
---|
172 | #ifdef SYSTEMC |
---|
173 | public : void transition (void); |
---|
174 | //public : void genMoore (void); |
---|
175 | public : void genMealy_decod (void); |
---|
176 | public : void genMealy_branch_complete (void); |
---|
177 | public : void genMealy_event (void); |
---|
178 | public : void genMealy_depth (void); |
---|
179 | #endif |
---|
180 | |
---|
181 | #if VHDL |
---|
182 | public : void vhdl (void); |
---|
183 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
184 | private : void vhdl_body (Vhdl * & vhdl); |
---|
185 | #endif |
---|
186 | |
---|
187 | #ifdef STATISTICS |
---|
188 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
189 | public : void statistics_deallocation (void); |
---|
190 | #endif |
---|
191 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
192 | private : void end_cycle (void); |
---|
193 | #endif |
---|
194 | }; |
---|
195 | |
---|
196 | }; // end namespace front_end_glue |
---|
197 | }; // end namespace front_end |
---|
198 | }; // end namespace multi_front_end |
---|
199 | }; // end namespace core |
---|
200 | |
---|
201 | }; // end namespace behavioural |
---|
202 | }; // end namespace morpheo |
---|
203 | |
---|
204 | #endif |
---|