1 | /* |
---|
2 | * $Id: Custom_default.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Custom/include/Custom_default.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace custom { |
---|
13 | |
---|
14 | #undef FUNCTION |
---|
15 | #define FUNCTION "custom::default_get_valid_group" |
---|
16 | bool default_get_valid_group (uint32_t group) |
---|
17 | { |
---|
18 | switch (group) |
---|
19 | { |
---|
20 | case 24 : // CUSTOM_1 |
---|
21 | case 25 : // CUSTOM_2 |
---|
22 | case 26 : // CUSTOM_3 |
---|
23 | case 27 : // CUSTOM_4 |
---|
24 | case 28 : // CUSTOM_5 |
---|
25 | case 29 : // CUSTOM_6 |
---|
26 | case 30 : // CUSTOM_7 |
---|
27 | case 31 : // CUSTOM_8 |
---|
28 | { |
---|
29 | break; |
---|
30 | } |
---|
31 | default : |
---|
32 | { |
---|
33 | throw ERRORMORPHEO(FUNCTION, "Invalid custom group number"); |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | return false; // default return |
---|
38 | } |
---|
39 | |
---|
40 | #undef FUNCTION |
---|
41 | #define FUNCTION "custom::default_get_nb_register" |
---|
42 | uint32_t default_get_nb_register (uint32_t group) |
---|
43 | { |
---|
44 | switch (group) |
---|
45 | { |
---|
46 | case 24 : // CUSTOM_1 |
---|
47 | case 25 : // CUSTOM_2 |
---|
48 | case 26 : // CUSTOM_3 |
---|
49 | case 27 : // CUSTOM_4 |
---|
50 | case 28 : // CUSTOM_5 |
---|
51 | case 29 : // CUSTOM_6 |
---|
52 | case 30 : // CUSTOM_7 |
---|
53 | case 31 : // CUSTOM_8 |
---|
54 | { |
---|
55 | break; |
---|
56 | } |
---|
57 | default : |
---|
58 | { |
---|
59 | throw ERRORMORPHEO(FUNCTION, "Invalid custom group number"); |
---|
60 | } |
---|
61 | } |
---|
62 | |
---|
63 | return 0; // default return |
---|
64 | } |
---|
65 | |
---|
66 | #undef FUNCTION |
---|
67 | #define FUNCTION "custom::default_get_access_mode" |
---|
68 | access_mode_t default_get_access_mode (uint32_t group, uint32_t reg) |
---|
69 | { |
---|
70 | if (reg < default_get_nb_register (group)) |
---|
71 | switch (group) |
---|
72 | { |
---|
73 | case 24 : // CUSTOM_1 |
---|
74 | case 25 : // CUSTOM_2 |
---|
75 | case 26 : // CUSTOM_3 |
---|
76 | case 27 : // CUSTOM_4 |
---|
77 | case 28 : // CUSTOM_5 |
---|
78 | case 29 : // CUSTOM_6 |
---|
79 | case 30 : // CUSTOM_7 |
---|
80 | case 31 : // CUSTOM_8 |
---|
81 | { |
---|
82 | break; |
---|
83 | } |
---|
84 | default : |
---|
85 | { |
---|
86 | throw ERRORMORPHEO(FUNCTION, "Invalid custom group number"); |
---|
87 | } |
---|
88 | } |
---|
89 | |
---|
90 | return access_mode_t (SPR_ACCESS_MODE_NONE, SPR_ACCESS_MODE_NONE); // default return |
---|
91 | } |
---|
92 | |
---|
93 | #undef FUNCTION |
---|
94 | #define FUNCTION "custom::default_get_custom_decod" |
---|
95 | custom_decod_t * default_get_custom_decod (Toperation_t operation) |
---|
96 | { |
---|
97 | switch (operation) |
---|
98 | { |
---|
99 | case OPERATION_CUSTOM_L_1 : |
---|
100 | case OPERATION_CUSTOM_L_2 : |
---|
101 | case OPERATION_CUSTOM_L_3 : |
---|
102 | case OPERATION_CUSTOM_L_4 : |
---|
103 | case OPERATION_CUSTOM_L_5 : |
---|
104 | case OPERATION_CUSTOM_L_6 : |
---|
105 | case OPERATION_CUSTOM_L_7 : |
---|
106 | case OPERATION_CUSTOM_L_8 : |
---|
107 | case OPERATION_CUSTOM_LF_1_D : |
---|
108 | case OPERATION_CUSTOM_LF_1_S : |
---|
109 | case OPERATION_CUSTOM_LV_1 : |
---|
110 | case OPERATION_CUSTOM_LV_2 : |
---|
111 | case OPERATION_CUSTOM_LV_3 : |
---|
112 | case OPERATION_CUSTOM_LV_4 : |
---|
113 | { |
---|
114 | break; |
---|
115 | } |
---|
116 | default : |
---|
117 | { |
---|
118 | throw ERRORMORPHEO(FUNCTION, "Invalid custom operation"); |
---|
119 | } |
---|
120 | } |
---|
121 | |
---|
122 | return &(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::instruction_illegal); // unimplemented function |
---|
123 | } |
---|
124 | |
---|
125 | #undef FUNCTION |
---|
126 | #define FUNCTION "custom::default_get_custom_execute_genMoore" |
---|
127 | custom_execute_genMoore_t * default_get_custom_execute_genMoore (Toperation_t operation) |
---|
128 | { |
---|
129 | switch (operation) |
---|
130 | { |
---|
131 | case OPERATION_CUSTOM_L_1 : |
---|
132 | case OPERATION_CUSTOM_L_2 : |
---|
133 | case OPERATION_CUSTOM_L_3 : |
---|
134 | case OPERATION_CUSTOM_L_4 : |
---|
135 | case OPERATION_CUSTOM_L_5 : |
---|
136 | case OPERATION_CUSTOM_L_6 : |
---|
137 | case OPERATION_CUSTOM_L_7 : |
---|
138 | case OPERATION_CUSTOM_L_8 : |
---|
139 | case OPERATION_CUSTOM_LF_1_D : |
---|
140 | case OPERATION_CUSTOM_LF_1_S : |
---|
141 | case OPERATION_CUSTOM_LV_1 : |
---|
142 | case OPERATION_CUSTOM_LV_2 : |
---|
143 | case OPERATION_CUSTOM_LV_3 : |
---|
144 | case OPERATION_CUSTOM_LV_4 : |
---|
145 | { |
---|
146 | break; |
---|
147 | } |
---|
148 | default : |
---|
149 | { |
---|
150 | throw ERRORMORPHEO(FUNCTION, "Invalid custom operation"); |
---|
151 | } |
---|
152 | } |
---|
153 | |
---|
154 | return &(morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::operation_unimplemented); // unimplemented function |
---|
155 | } |
---|
156 | |
---|
157 | #undef FUNCTION |
---|
158 | #define FUNCTION "custom::default_get_custom_execute_transition" |
---|
159 | custom_execute_transition_t * default_get_custom_execute_transition (uint32_t group) |
---|
160 | { |
---|
161 | switch (group) |
---|
162 | { |
---|
163 | case 24 : // CUSTOM_1 |
---|
164 | case 25 : // CUSTOM_2 |
---|
165 | case 26 : // CUSTOM_3 |
---|
166 | case 27 : // CUSTOM_4 |
---|
167 | case 28 : // CUSTOM_5 |
---|
168 | case 29 : // CUSTOM_6 |
---|
169 | case 30 : // CUSTOM_7 |
---|
170 | case 31 : // CUSTOM_8 |
---|
171 | { |
---|
172 | break; |
---|
173 | } |
---|
174 | default : |
---|
175 | { |
---|
176 | throw ERRORMORPHEO(FUNCTION, "Invalid custom group number"); |
---|
177 | } |
---|
178 | } |
---|
179 | |
---|
180 | return NULL; // unimplemented function |
---|
181 | } |
---|
182 | |
---|
183 | #undef FUNCTION |
---|
184 | #define FUNCTION "custom::default_get_custom_execute_reset" |
---|
185 | custom_execute_transition_t * default_get_custom_execute_reset (uint32_t group) |
---|
186 | { |
---|
187 | switch (group) |
---|
188 | { |
---|
189 | case 24 : // CUSTOM_1 |
---|
190 | case 25 : // CUSTOM_2 |
---|
191 | case 26 : // CUSTOM_3 |
---|
192 | case 27 : // CUSTOM_4 |
---|
193 | case 28 : // CUSTOM_5 |
---|
194 | case 29 : // CUSTOM_6 |
---|
195 | case 30 : // CUSTOM_7 |
---|
196 | case 31 : // CUSTOM_8 |
---|
197 | { |
---|
198 | break; |
---|
199 | } |
---|
200 | default : |
---|
201 | { |
---|
202 | throw ERRORMORPHEO(FUNCTION, "Invalid custom group number"); |
---|
203 | } |
---|
204 | } |
---|
205 | |
---|
206 | return NULL; // unimplemented function |
---|
207 | } |
---|
208 | |
---|
209 | #undef FUNCTION |
---|
210 | #define FUNCTION "custom::default_get_vhdl_decod" |
---|
211 | custom_vhdl_t * default_get_vhdl_decod (void) |
---|
212 | { |
---|
213 | return NULL; // unimplemented function |
---|
214 | } |
---|
215 | |
---|
216 | #undef FUNCTION |
---|
217 | #define FUNCTION "custom::default_get_vhdl_execute" |
---|
218 | custom_vhdl_t * default_get_vhdl_execute (void) |
---|
219 | { |
---|
220 | return NULL; // unimplemented function |
---|
221 | } |
---|
222 | |
---|
223 | #undef FUNCTION |
---|
224 | #define FUNCTION "custom::default_get_custom_information" |
---|
225 | //custom_information_t default_get_custom_information (uint32_t context) |
---|
226 | custom_information_t default_get_custom_information (void) |
---|
227 | { |
---|
228 | custom_information_t info; |
---|
229 | |
---|
230 | info._get_valid_group = &morpheo::behavioural::custom::default_get_valid_group ; |
---|
231 | info._get_nb_register = &morpheo::behavioural::custom::default_get_nb_register ; |
---|
232 | info._get_access_mode = &morpheo::behavioural::custom::default_get_access_mode ; |
---|
233 | info._get_custom_decod = &morpheo::behavioural::custom::default_get_custom_decod ; |
---|
234 | info._get_custom_execute_genMoore = &morpheo::behavioural::custom::default_get_custom_execute_genMoore ; |
---|
235 | info._get_custom_execute_transition = &morpheo::behavioural::custom::default_get_custom_execute_transition; |
---|
236 | info._get_custom_execute_reset = &morpheo::behavioural::custom::default_get_custom_execute_reset ; |
---|
237 | info._get_vhdl_decod = &morpheo::behavioural::custom::default_get_vhdl_decod ; |
---|
238 | info._get_vhdl_execute = &morpheo::behavioural::custom::default_get_vhdl_execute ; |
---|
239 | |
---|
240 | return info; |
---|
241 | } |
---|
242 | |
---|
243 | }; // end namespace custom |
---|
244 | }; // end namespace behavioural |
---|
245 | }; // end namespace morpheo |
---|