1 | #ifdef SYSTEMC |
---|
2 | #include "systemc.h" |
---|
3 | #endif |
---|
4 | #include <iostream> |
---|
5 | #include "../include/Environment.h" |
---|
6 | |
---|
7 | using namespace std; |
---|
8 | using namespace environment; |
---|
9 | using namespace morpheo; |
---|
10 | |
---|
11 | #define _TEST_IMEMORY_ true |
---|
12 | #define _TEST_DMEMORY_ true |
---|
13 | #define _TEST_TTY_ true |
---|
14 | #define _TEST_RAMLOCK_ true |
---|
15 | #define _TEST_SIM2OS_ true |
---|
16 | |
---|
17 | #define TEST(x,y) \ |
---|
18 | { \ |
---|
19 | cout << "Line " << __LINE__ << " : "; \ |
---|
20 | if (x==y) \ |
---|
21 | { \ |
---|
22 | cout << "Test OK" << endl; \ |
---|
23 | } \ |
---|
24 | else \ |
---|
25 | { \ |
---|
26 | cout << "Test KO" << endl; \ |
---|
27 | exit (EXIT_FAILURE); \ |
---|
28 | } \ |
---|
29 | } while (0) |
---|
30 | |
---|
31 | int sc_main (int argc, char * argv[]) |
---|
32 | { |
---|
33 | cout << "<main> Begin" << endl; |
---|
34 | |
---|
35 | { |
---|
36 | uint32_t nb_entity = 2; |
---|
37 | |
---|
38 | uint32_t * iaccess_nb_context = new uint32_t [nb_entity]; |
---|
39 | uint32_t * iaccess_nb_instruction= new uint32_t [nb_entity]; |
---|
40 | uint32_t * iaccess_nb_packet = new uint32_t [nb_entity]; |
---|
41 | uint32_t * iaccess_size_address = new uint32_t [nb_entity]; |
---|
42 | uint32_t * iaccess_size_data = new uint32_t [nb_entity]; |
---|
43 | |
---|
44 | uint32_t * daccess_nb_context = new uint32_t [nb_entity]; |
---|
45 | uint32_t * daccess_nb_packet = new uint32_t [nb_entity]; |
---|
46 | uint32_t * daccess_size_address = new uint32_t [nb_entity]; |
---|
47 | uint32_t * daccess_size_data = new uint32_t [nb_entity]; |
---|
48 | |
---|
49 | uint32_t * buffer_irsp_size = new uint32_t [nb_entity]; |
---|
50 | uint32_t * buffer_drsp_size = new uint32_t [nb_entity]; |
---|
51 | |
---|
52 | for (uint32_t i=0; i<nb_entity; i++) |
---|
53 | { |
---|
54 | iaccess_nb_context [i] = 4; |
---|
55 | iaccess_nb_instruction [i] = 4; |
---|
56 | iaccess_nb_packet [i] = 4; |
---|
57 | iaccess_size_address [i] = 32; |
---|
58 | iaccess_size_data [i] = 32; |
---|
59 | |
---|
60 | daccess_nb_context [i] = 4; |
---|
61 | daccess_nb_packet [i] = 4; |
---|
62 | daccess_size_address [i] = 32; |
---|
63 | daccess_size_data [i] = 32; |
---|
64 | |
---|
65 | buffer_irsp_size [i] = 8; |
---|
66 | buffer_drsp_size [i] = 8; |
---|
67 | } |
---|
68 | |
---|
69 | uint32_t * cache_shared_nb_line = new uint32_t [1]; |
---|
70 | uint32_t * cache_shared_size_line = new uint32_t [1]; |
---|
71 | uint32_t * cache_shared_size_word = new uint32_t [1]; |
---|
72 | uint32_t * cache_shared_associativity = new uint32_t [1]; |
---|
73 | uint32_t * cache_shared_hit_latence = new uint32_t [1]; |
---|
74 | uint32_t * cache_shared_miss_penality = new uint32_t [1]; |
---|
75 | |
---|
76 | cache_shared_nb_line [0] = 8 ; |
---|
77 | cache_shared_size_line [0] = 8 ; |
---|
78 | cache_shared_size_word [0] = 4 ; |
---|
79 | cache_shared_associativity [0] = 4 ; |
---|
80 | cache_shared_hit_latence [0] = 2 ; |
---|
81 | cache_shared_miss_penality [0] = 5 ; |
---|
82 | |
---|
83 | uint32_t * icache_nb_level = new uint32_t [nb_entity]; |
---|
84 | uint32_t * icache_nb_port = new uint32_t [nb_entity]; |
---|
85 | uint32_t ** icache_nb_line = new uint32_t * [nb_entity]; |
---|
86 | uint32_t ** icache_size_line = new uint32_t * [nb_entity]; |
---|
87 | uint32_t ** icache_size_word = new uint32_t * [nb_entity]; |
---|
88 | uint32_t ** icache_associativity = new uint32_t * [nb_entity]; |
---|
89 | uint32_t ** icache_hit_latence = new uint32_t * [nb_entity]; |
---|
90 | uint32_t ** icache_miss_penality = new uint32_t * [nb_entity]; |
---|
91 | |
---|
92 | for (uint32_t i=0; i<nb_entity; i++) |
---|
93 | { |
---|
94 | icache_nb_level [i] = 1; |
---|
95 | icache_nb_port [i] = 2; |
---|
96 | icache_nb_line [i] = new uint32_t [1]; |
---|
97 | icache_size_line [i] = new uint32_t [1]; |
---|
98 | icache_size_word [i] = new uint32_t [1]; |
---|
99 | icache_associativity [i] = new uint32_t [1]; |
---|
100 | icache_hit_latence [i] = new uint32_t [1]; |
---|
101 | icache_miss_penality [i] = new uint32_t [1]; |
---|
102 | |
---|
103 | icache_nb_line [i][0] = 8; |
---|
104 | icache_size_line [i][0] = 8; |
---|
105 | icache_size_word [i][0] = 4; |
---|
106 | icache_associativity [i][0] = 1; |
---|
107 | icache_hit_latence [i][0] = 1; |
---|
108 | icache_miss_penality [i][0] = 3; |
---|
109 | } |
---|
110 | |
---|
111 | uint32_t * dcache_nb_level = new uint32_t [nb_entity]; |
---|
112 | uint32_t * dcache_nb_port = new uint32_t [nb_entity]; |
---|
113 | uint32_t ** dcache_nb_line = new uint32_t * [nb_entity]; |
---|
114 | uint32_t ** dcache_size_line = new uint32_t * [nb_entity]; |
---|
115 | uint32_t ** dcache_size_word = new uint32_t * [nb_entity]; |
---|
116 | uint32_t ** dcache_associativity = new uint32_t * [nb_entity]; |
---|
117 | uint32_t ** dcache_hit_latence = new uint32_t * [nb_entity]; |
---|
118 | uint32_t ** dcache_miss_penality = new uint32_t * [nb_entity]; |
---|
119 | |
---|
120 | for (uint32_t i=0; i<nb_entity; i++) |
---|
121 | { |
---|
122 | dcache_nb_level [i] = 1; |
---|
123 | dcache_nb_port [i] = 2; |
---|
124 | dcache_nb_line [i] = new uint32_t [1]; |
---|
125 | dcache_size_line [i] = new uint32_t [1]; |
---|
126 | dcache_size_word [i] = new uint32_t [1]; |
---|
127 | dcache_associativity [i] = new uint32_t [1]; |
---|
128 | dcache_hit_latence [i] = new uint32_t [1]; |
---|
129 | dcache_miss_penality [i] = new uint32_t [1]; |
---|
130 | |
---|
131 | dcache_nb_line [i][0] = 8; |
---|
132 | dcache_size_line [i][0] = 8; |
---|
133 | dcache_size_word [i][0] = 4; |
---|
134 | dcache_associativity [i][0] = 1; |
---|
135 | dcache_hit_latence [i][0] = 1; |
---|
136 | dcache_miss_penality [i][0] = 3; |
---|
137 | } |
---|
138 | |
---|
139 | uint32_t nb_component_tty = 1; |
---|
140 | uint32_t * tty_address = new uint32_t [nb_component_tty]; |
---|
141 | uint32_t * nb_tty = new uint32_t [nb_component_tty]; |
---|
142 | tty_address [0] = 0xa0000000; |
---|
143 | nb_tty [0] = 4; |
---|
144 | string ** name_tty = new string * [nb_component_tty]; |
---|
145 | name_tty [0] = new string [nb_tty[0]]; |
---|
146 | name_tty [0][0] = "tty_0_0"; |
---|
147 | name_tty [0][1] = "tty_0_1"; |
---|
148 | name_tty [0][2] = "tty_0_2"; |
---|
149 | name_tty [0][3] = "tty_0_3"; |
---|
150 | |
---|
151 | uint32_t nb_component_ramlock = 1; |
---|
152 | uint32_t * ramlock_address = new uint32_t [nb_component_ramlock]; |
---|
153 | uint32_t * nb_lock = new uint32_t [nb_component_ramlock]; |
---|
154 | ramlock_address [0] = 0xb0000000; |
---|
155 | nb_lock [0] = 10; |
---|
156 | |
---|
157 | uint32_t sim2os_address = 0xc0000000; |
---|
158 | uint32_t sim2os_size = 0x00001000; |
---|
159 | SOCLIB_SEGMENT_TABLE * segtable = new SOCLIB_SEGMENT_TABLE; |
---|
160 | segtable->setMSBNumber (8); |
---|
161 | segtable->setDefaultTarget(0,0); |
---|
162 | |
---|
163 | //shared data segment |
---|
164 | const int TEXT_BASE = 0x00000000; |
---|
165 | const int DATA_CACHED_BASE = 0x10000000; |
---|
166 | const int DATA_UNCACHED_BASE = 0x40000000; |
---|
167 | |
---|
168 | const int TEXT_SIZE = 0x4000; |
---|
169 | const int DATA_CACHED_SIZE = 0x4000; |
---|
170 | const int DATA_UNCACHED_SIZE = 0x4000; |
---|
171 | |
---|
172 | // Add a segment ,name ,address of base ,size ,global index,local index,uncache |
---|
173 | segtable->addSegment("text" ,TEXT_BASE ,TEXT_SIZE ,0 ,0 ,false); |
---|
174 | segtable->addSegment("data" ,DATA_CACHED_BASE ,DATA_CACHED_SIZE ,0 ,0 ,false); |
---|
175 | segtable->addSegment("data_unc",DATA_UNCACHED_BASE,DATA_UNCACHED_SIZE,0 ,0 ,true ); |
---|
176 | |
---|
177 | |
---|
178 | Parameters * param = new Parameters |
---|
179 | (nb_entity, |
---|
180 | nb_entity, |
---|
181 | |
---|
182 | iaccess_nb_context, |
---|
183 | iaccess_nb_instruction, |
---|
184 | iaccess_nb_packet, |
---|
185 | iaccess_size_address, |
---|
186 | iaccess_size_data, |
---|
187 | |
---|
188 | daccess_nb_context, |
---|
189 | daccess_nb_packet, |
---|
190 | daccess_size_address, |
---|
191 | daccess_size_data, |
---|
192 | |
---|
193 | buffer_irsp_size, |
---|
194 | buffer_drsp_size, |
---|
195 | |
---|
196 | icache_nb_level , |
---|
197 | icache_nb_port , |
---|
198 | icache_nb_line , |
---|
199 | icache_size_line , |
---|
200 | icache_size_word , |
---|
201 | icache_associativity, |
---|
202 | icache_hit_latence , |
---|
203 | icache_miss_penality, |
---|
204 | dcache_nb_level , |
---|
205 | dcache_nb_port , |
---|
206 | dcache_nb_line , |
---|
207 | dcache_size_line , |
---|
208 | dcache_size_word , |
---|
209 | dcache_associativity, |
---|
210 | dcache_hit_latence , |
---|
211 | dcache_miss_penality, |
---|
212 | 1 , |
---|
213 | // cache_shared_nb_port , |
---|
214 | cache_shared_nb_line , |
---|
215 | cache_shared_size_line , |
---|
216 | cache_shared_size_word , |
---|
217 | cache_shared_associativity , |
---|
218 | cache_shared_hit_latence , |
---|
219 | cache_shared_miss_penality , |
---|
220 | |
---|
221 | nb_component_tty, |
---|
222 | tty_address, |
---|
223 | nb_tty, |
---|
224 | name_tty, |
---|
225 | false, // don't execute xtty |
---|
226 | |
---|
227 | nb_component_ramlock, |
---|
228 | ramlock_address, |
---|
229 | nb_lock, |
---|
230 | |
---|
231 | sim2os_address, |
---|
232 | sim2os_size, |
---|
233 | segtable |
---|
234 | ); |
---|
235 | |
---|
236 | segtable->print(); |
---|
237 | |
---|
238 | Environment * env = new Environment ("environment",param); |
---|
239 | |
---|
240 | const char * filename = "Data/selftest/data/soft.x"; |
---|
241 | const char * sections_text [] = {".text",NULL}; |
---|
242 | const char * sections_data [] = {".data",".rodata",".bss",".sdata",".sbss", NULL}; |
---|
243 | |
---|
244 | env->init("text" , filename, sections_text); |
---|
245 | env->init("data" , filename, sections_data); |
---|
246 | |
---|
247 | // cout << "<main> Press <Enter> to stop the test" << endl; |
---|
248 | // getchar(); |
---|
249 | |
---|
250 | //============================================================================== |
---|
251 | //===== [ DECLARATION ]========================================================= |
---|
252 | //============================================================================== |
---|
253 | |
---|
254 | sc_clock * CLOCK = new sc_clock ("clock", 1.0, 0.5); |
---|
255 | sc_signal<bool> * NRESET = new sc_signal<bool> ("NRESET"); |
---|
256 | |
---|
257 | sc_signal<Tcontrol_t > *** ICACHE_REQ_VAL = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
258 | sc_signal<Tcontrol_t > *** ICACHE_REQ_ACK = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
259 | sc_signal<Ticache_context_t > *** ICACHE_REQ_CONTEXT_ID = new sc_signal<Ticache_context_t > ** [nb_entity]; |
---|
260 | sc_signal<Ticache_packet_t > *** ICACHE_REQ_PACKET_ID = new sc_signal<Ticache_packet_t > ** [nb_entity]; |
---|
261 | sc_signal<Ticache_address_t > *** ICACHE_REQ_ADDRESS = new sc_signal<Ticache_address_t > ** [nb_entity]; |
---|
262 | sc_signal<Ticache_type_t > *** ICACHE_REQ_TYPE = new sc_signal<Ticache_type_t > ** [nb_entity]; |
---|
263 | |
---|
264 | sc_signal<Tcontrol_t > *** ICACHE_RSP_VAL = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
265 | sc_signal<Tcontrol_t > *** ICACHE_RSP_ACK = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
266 | sc_signal<Ticache_context_t > *** ICACHE_RSP_CONTEXT_ID = new sc_signal<Ticache_context_t > ** [nb_entity]; |
---|
267 | sc_signal<Ticache_packet_t > *** ICACHE_RSP_PACKET_ID = new sc_signal<Ticache_packet_t > ** [nb_entity]; |
---|
268 | sc_signal<Ticache_instruction_t> **** ICACHE_RSP_INSTRUCTION= new sc_signal<Ticache_instruction_t> *** [nb_entity];//[nb_instruction] |
---|
269 | sc_signal<Ticache_error_t > *** ICACHE_RSP_ERROR = new sc_signal<Ticache_error_t > ** [nb_entity]; |
---|
270 | |
---|
271 | sc_signal<Tcontrol_t > *** DCACHE_REQ_VAL = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
272 | sc_signal<Tcontrol_t > *** DCACHE_REQ_ACK = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
273 | sc_signal<Tdcache_context_t > *** DCACHE_REQ_CONTEXT_ID = new sc_signal<Tdcache_context_t > ** [nb_entity]; |
---|
274 | sc_signal<Tdcache_packet_t > *** DCACHE_REQ_PACKET_ID = new sc_signal<Tdcache_packet_t > ** [nb_entity]; |
---|
275 | sc_signal<Tdcache_address_t > *** DCACHE_REQ_ADDRESS = new sc_signal<Tdcache_address_t > ** [nb_entity]; |
---|
276 | sc_signal<Tdcache_type_t > *** DCACHE_REQ_TYPE = new sc_signal<Tdcache_type_t > ** [nb_entity]; |
---|
277 | sc_signal<Tdcache_data_t > *** DCACHE_REQ_WDATA = new sc_signal<Tdcache_data_t > ** [nb_entity]; |
---|
278 | |
---|
279 | sc_signal<Tcontrol_t > *** DCACHE_RSP_VAL = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
280 | sc_signal<Tcontrol_t > *** DCACHE_RSP_ACK = new sc_signal<Tcontrol_t > ** [nb_entity]; |
---|
281 | sc_signal<Tdcache_context_t > *** DCACHE_RSP_CONTEXT_ID = new sc_signal<Tdcache_context_t > ** [nb_entity]; |
---|
282 | sc_signal<Tdcache_packet_t > *** DCACHE_RSP_PACKET_ID = new sc_signal<Tdcache_packet_t > ** [nb_entity]; |
---|
283 | sc_signal<Tdcache_data_t > *** DCACHE_RSP_RDATA = new sc_signal<Tdcache_data_t > ** [nb_entity]; |
---|
284 | sc_signal<Tdcache_error_t > *** DCACHE_RSP_ERROR = new sc_signal<Tdcache_error_t > ** [nb_entity]; |
---|
285 | |
---|
286 | for (uint32_t i=0; i<nb_entity; i++) |
---|
287 | { |
---|
288 | ICACHE_REQ_VAL [i] = new sc_signal<Tcontrol_t > * [icache_nb_port[i]]; |
---|
289 | ICACHE_REQ_ACK [i] = new sc_signal<Tcontrol_t > * [icache_nb_port[i]]; |
---|
290 | ICACHE_REQ_CONTEXT_ID [i] = new sc_signal<Ticache_context_t > * [icache_nb_port[i]]; |
---|
291 | ICACHE_REQ_PACKET_ID [i] = new sc_signal<Ticache_packet_t > * [icache_nb_port[i]]; |
---|
292 | ICACHE_REQ_ADDRESS [i] = new sc_signal<Ticache_address_t > * [icache_nb_port[i]]; |
---|
293 | ICACHE_REQ_TYPE [i] = new sc_signal<Ticache_type_t > * [icache_nb_port[i]]; |
---|
294 | |
---|
295 | ICACHE_RSP_VAL [i] = new sc_signal<Tcontrol_t > * [icache_nb_port[i]]; |
---|
296 | ICACHE_RSP_ACK [i] = new sc_signal<Tcontrol_t > * [icache_nb_port[i]]; |
---|
297 | ICACHE_RSP_CONTEXT_ID [i] = new sc_signal<Ticache_context_t > * [icache_nb_port[i]]; |
---|
298 | ICACHE_RSP_PACKET_ID [i] = new sc_signal<Ticache_packet_t > * [icache_nb_port[i]]; |
---|
299 | ICACHE_RSP_INSTRUCTION[i] = new sc_signal<Ticache_instruction_t> ** [icache_nb_port[i]];//[nb_instruction] |
---|
300 | ICACHE_RSP_ERROR [i] = new sc_signal<Ticache_error_t > * [icache_nb_port[i]]; |
---|
301 | |
---|
302 | for (uint32_t j=0; j<icache_nb_port[i]; j++) |
---|
303 | { |
---|
304 | ICACHE_REQ_VAL [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
305 | ICACHE_REQ_ACK [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
306 | ICACHE_REQ_CONTEXT_ID [i][j] = new sc_signal<Ticache_context_t > (""); |
---|
307 | ICACHE_REQ_PACKET_ID [i][j] = new sc_signal<Ticache_packet_t > (""); |
---|
308 | ICACHE_REQ_ADDRESS [i][j] = new sc_signal<Ticache_address_t > (""); |
---|
309 | ICACHE_REQ_TYPE [i][j] = new sc_signal<Ticache_type_t > (""); |
---|
310 | |
---|
311 | ICACHE_RSP_VAL [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
312 | ICACHE_RSP_ACK [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
313 | ICACHE_RSP_CONTEXT_ID [i][j] = new sc_signal<Ticache_context_t > (""); |
---|
314 | ICACHE_RSP_PACKET_ID [i][j] = new sc_signal<Ticache_packet_t > (""); |
---|
315 | ICACHE_RSP_ERROR [i][j] = new sc_signal<Ticache_error_t > (""); |
---|
316 | |
---|
317 | ICACHE_RSP_INSTRUCTION [i][j] = new sc_signal<Ticache_instruction_t> * [iaccess_nb_instruction[i]]; |
---|
318 | |
---|
319 | for (uint32_t k=0; k<iaccess_nb_instruction[i]; k++) |
---|
320 | ICACHE_RSP_INSTRUCTION [i][j][k] = new sc_signal<Ticache_instruction_t> (""); |
---|
321 | |
---|
322 | } |
---|
323 | |
---|
324 | DCACHE_REQ_VAL [i] = new sc_signal<Tcontrol_t > * [dcache_nb_port[i]]; |
---|
325 | DCACHE_REQ_ACK [i] = new sc_signal<Tcontrol_t > * [dcache_nb_port[i]]; |
---|
326 | DCACHE_REQ_CONTEXT_ID [i] = new sc_signal<Tdcache_context_t > * [dcache_nb_port[i]]; |
---|
327 | DCACHE_REQ_PACKET_ID [i] = new sc_signal<Tdcache_packet_t > * [dcache_nb_port[i]]; |
---|
328 | DCACHE_REQ_ADDRESS [i] = new sc_signal<Tdcache_address_t > * [dcache_nb_port[i]]; |
---|
329 | DCACHE_REQ_TYPE [i] = new sc_signal<Tdcache_type_t > * [dcache_nb_port[i]]; |
---|
330 | DCACHE_REQ_WDATA [i] = new sc_signal<Tdcache_data_t > * [dcache_nb_port[i]]; |
---|
331 | |
---|
332 | DCACHE_RSP_VAL [i] = new sc_signal<Tcontrol_t > * [dcache_nb_port[i]]; |
---|
333 | DCACHE_RSP_ACK [i] = new sc_signal<Tcontrol_t > * [dcache_nb_port[i]]; |
---|
334 | DCACHE_RSP_CONTEXT_ID [i] = new sc_signal<Tdcache_context_t > * [dcache_nb_port[i]]; |
---|
335 | DCACHE_RSP_PACKET_ID [i] = new sc_signal<Tdcache_packet_t > * [dcache_nb_port[i]]; |
---|
336 | DCACHE_RSP_RDATA [i] = new sc_signal<Tdcache_data_t > * [dcache_nb_port[i]]; |
---|
337 | DCACHE_RSP_ERROR [i] = new sc_signal<Tdcache_error_t > * [dcache_nb_port[i]]; |
---|
338 | |
---|
339 | for (uint32_t j=0; j<dcache_nb_port[i]; j++) |
---|
340 | { |
---|
341 | DCACHE_REQ_VAL [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
342 | DCACHE_REQ_ACK [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
343 | DCACHE_REQ_CONTEXT_ID [i][j] = new sc_signal<Tdcache_context_t > (""); |
---|
344 | DCACHE_REQ_PACKET_ID [i][j] = new sc_signal<Tdcache_packet_t > (""); |
---|
345 | DCACHE_REQ_ADDRESS [i][j] = new sc_signal<Tdcache_address_t > (""); |
---|
346 | DCACHE_REQ_TYPE [i][j] = new sc_signal<Tdcache_type_t > (""); |
---|
347 | DCACHE_REQ_WDATA [i][j] = new sc_signal<Tdcache_data_t > (""); |
---|
348 | |
---|
349 | DCACHE_RSP_VAL [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
350 | DCACHE_RSP_ACK [i][j] = new sc_signal<Tcontrol_t > (""); |
---|
351 | DCACHE_RSP_CONTEXT_ID [i][j] = new sc_signal<Tdcache_context_t > (""); |
---|
352 | DCACHE_RSP_PACKET_ID [i][j] = new sc_signal<Tdcache_packet_t > (""); |
---|
353 | DCACHE_RSP_RDATA [i][j] = new sc_signal<Tdcache_data_t > (""); |
---|
354 | DCACHE_RSP_ERROR [i][j] = new sc_signal<Tdcache_error_t > (""); |
---|
355 | } |
---|
356 | } |
---|
357 | |
---|
358 | //============================================================================== |
---|
359 | //===== [ INSTANCE ]============================================================ |
---|
360 | //============================================================================== |
---|
361 | |
---|
362 | // instance |
---|
363 | (*(env->CLOCK )) (*(CLOCK )); |
---|
364 | (*(env->NRESET)) (*(NRESET)); |
---|
365 | |
---|
366 | for (uint32_t i=0; i<nb_entity; i++) |
---|
367 | { |
---|
368 | for (uint32_t j=0; j<icache_nb_port[i]; j++) |
---|
369 | { |
---|
370 | (*(env->ICACHE_REQ_VAL [i][j])) (*(ICACHE_REQ_VAL [i][j])); |
---|
371 | (*(env->ICACHE_REQ_ACK [i][j])) (*(ICACHE_REQ_ACK [i][j])); |
---|
372 | (*(env->ICACHE_REQ_CONTEXT_ID [i][j])) (*(ICACHE_REQ_CONTEXT_ID [i][j])); |
---|
373 | (*(env->ICACHE_REQ_PACKET_ID [i][j])) (*(ICACHE_REQ_PACKET_ID [i][j])); |
---|
374 | (*(env->ICACHE_REQ_ADDRESS [i][j])) (*(ICACHE_REQ_ADDRESS [i][j])); |
---|
375 | (*(env->ICACHE_REQ_TYPE [i][j])) (*(ICACHE_REQ_TYPE [i][j])); |
---|
376 | |
---|
377 | (*(env->ICACHE_RSP_VAL [i][j])) (*(ICACHE_RSP_VAL [i][j])); |
---|
378 | (*(env->ICACHE_RSP_ACK [i][j])) (*(ICACHE_RSP_ACK [i][j])); |
---|
379 | (*(env->ICACHE_RSP_CONTEXT_ID [i][j])) (*(ICACHE_RSP_CONTEXT_ID [i][j])); |
---|
380 | (*(env->ICACHE_RSP_PACKET_ID [i][j])) (*(ICACHE_RSP_PACKET_ID [i][j])); |
---|
381 | (*(env->ICACHE_RSP_ERROR [i][j])) (*(ICACHE_RSP_ERROR [i][j])); |
---|
382 | |
---|
383 | for (uint32_t k=0; k<iaccess_nb_instruction[i]; k++) |
---|
384 | (*(env->ICACHE_RSP_INSTRUCTION [i][j][k])) (*(ICACHE_RSP_INSTRUCTION [i][j][k])); |
---|
385 | |
---|
386 | } |
---|
387 | |
---|
388 | for (uint32_t j=0; j<dcache_nb_port[i]; j++) |
---|
389 | { |
---|
390 | (*(env->DCACHE_REQ_VAL [i][j])) (*(DCACHE_REQ_VAL [i][j])); |
---|
391 | (*(env->DCACHE_REQ_ACK [i][j])) (*(DCACHE_REQ_ACK [i][j])); |
---|
392 | (*(env->DCACHE_REQ_CONTEXT_ID [i][j])) (*(DCACHE_REQ_CONTEXT_ID [i][j])); |
---|
393 | (*(env->DCACHE_REQ_PACKET_ID [i][j])) (*(DCACHE_REQ_PACKET_ID [i][j])); |
---|
394 | (*(env->DCACHE_REQ_ADDRESS [i][j])) (*(DCACHE_REQ_ADDRESS [i][j])); |
---|
395 | (*(env->DCACHE_REQ_TYPE [i][j])) (*(DCACHE_REQ_TYPE [i][j])); |
---|
396 | (*(env->DCACHE_REQ_WDATA [i][j])) (*(DCACHE_REQ_WDATA [i][j])); |
---|
397 | |
---|
398 | (*(env->DCACHE_RSP_VAL [i][j])) (*(DCACHE_RSP_VAL [i][j])); |
---|
399 | (*(env->DCACHE_RSP_ACK [i][j])) (*(DCACHE_RSP_ACK [i][j])); |
---|
400 | (*(env->DCACHE_RSP_CONTEXT_ID [i][j])) (*(DCACHE_RSP_CONTEXT_ID [i][j])); |
---|
401 | (*(env->DCACHE_RSP_PACKET_ID [i][j])) (*(DCACHE_RSP_PACKET_ID [i][j])); |
---|
402 | (*(env->DCACHE_RSP_RDATA [i][j])) (*(DCACHE_RSP_RDATA [i][j])); |
---|
403 | (*(env->DCACHE_RSP_ERROR [i][j])) (*(DCACHE_RSP_ERROR [i][j])); |
---|
404 | } |
---|
405 | } |
---|
406 | |
---|
407 | //============================================================================== |
---|
408 | //===== [ INIT ]================================================================ |
---|
409 | //============================================================================== |
---|
410 | |
---|
411 | const uint32_t seed = 0; |
---|
412 | // const uint32_t seed = static_cast<uint32_t>(time(NULL)); |
---|
413 | srand(seed); |
---|
414 | |
---|
415 | sc_start(0); |
---|
416 | // reset |
---|
417 | NRESET->write(0); |
---|
418 | sc_start(5); |
---|
419 | NRESET->write(1); |
---|
420 | sc_start(1); |
---|
421 | |
---|
422 | // cout << *env << endl; |
---|
423 | |
---|
424 | //============================================================================== |
---|
425 | //===== [ ICACHE ]============================================================== |
---|
426 | //============================================================================== |
---|
427 | |
---|
428 | if (_TEST_IMEMORY_) |
---|
429 | { |
---|
430 | cout << "Test : ICACHE" << endl; |
---|
431 | // Test no respons |
---|
432 | |
---|
433 | for (uint32_t i = 0; i < param->nb_entity; i++) |
---|
434 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
435 | { |
---|
436 | TEST(ICACHE_RSP_VAL [i][j]->read(), 0); |
---|
437 | ICACHE_RSP_ACK [i][j]->write(0); |
---|
438 | } |
---|
439 | |
---|
440 | for (uint32_t i = 0; i < param->nb_entity; i++) |
---|
441 | for (uint32_t j=0; j<param->dcache_dedicated_nb_port [i]; j++) |
---|
442 | { |
---|
443 | TEST(DCACHE_RSP_VAL [i][j]->read(), 0); |
---|
444 | DCACHE_RSP_ACK [i][j]->write(0); |
---|
445 | } |
---|
446 | |
---|
447 | const int32_t percent_transaction_icache_req = 75; |
---|
448 | const int32_t percent_transaction_icache_rsp = 75; |
---|
449 | |
---|
450 | uint32_t packet_req = 0; |
---|
451 | uint32_t packet_rsp = 0; |
---|
452 | |
---|
453 | Ticache_address_t addr_max = 0xf0; |
---|
454 | |
---|
455 | do |
---|
456 | { |
---|
457 | Ticache_packet_t packet_req_next = packet_req; |
---|
458 | |
---|
459 | Ticache_address_t addr = (packet_req_next << 2); |
---|
460 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
461 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
462 | { |
---|
463 | ICACHE_REQ_VAL [i][j]->write((addr < addr_max) and ((rand()%100)<percent_transaction_icache_req)); |
---|
464 | ICACHE_REQ_CONTEXT_ID [i][j]->write(0); |
---|
465 | ICACHE_REQ_ADDRESS [i][j]->write(addr>>2); |
---|
466 | ICACHE_REQ_PACKET_ID [i][j]->write(addr>>2); |
---|
467 | ICACHE_REQ_TYPE [i][j]->write(ICACHE_TYPE_LOAD); |
---|
468 | |
---|
469 | packet_req_next++; |
---|
470 | addr += (param->iaccess_nb_instruction[i]<<2); |
---|
471 | } |
---|
472 | |
---|
473 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
474 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
475 | { |
---|
476 | ICACHE_RSP_ACK [i][j]->write((rand()%100)<percent_transaction_icache_rsp) ; |
---|
477 | } |
---|
478 | |
---|
479 | sc_start(1); |
---|
480 | |
---|
481 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
482 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
483 | { |
---|
484 | cout << "ICACHE_REQ_VALACK (" << ICACHE_REQ_VAL [i][j]->read() << "," << ICACHE_REQ_ACK [i][j]->read() << ")" << endl; |
---|
485 | if (ICACHE_REQ_VAL [i][j]->read() and |
---|
486 | ICACHE_REQ_ACK [i][j]->read()) |
---|
487 | { |
---|
488 | cout << "packet_req : " << packet_req << endl; |
---|
489 | packet_req ++; |
---|
490 | } |
---|
491 | } |
---|
492 | |
---|
493 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
494 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
495 | { |
---|
496 | cout << "ICACHE_RSP_VALACK (" << ICACHE_RSP_VAL [i][j]->read() << "," << ICACHE_RSP_ACK [i][j]->read() << ")" << endl; |
---|
497 | if (ICACHE_RSP_VAL [i][j]->read() and |
---|
498 | ICACHE_RSP_ACK [i][j]->read()) |
---|
499 | { |
---|
500 | cout << "packet_rsp : " << packet_rsp << endl; |
---|
501 | packet_rsp ++; |
---|
502 | |
---|
503 | TEST(ICACHE_RSP_ERROR [i][j]->read(),ICACHE_ERROR_NONE); |
---|
504 | TEST(ICACHE_RSP_CONTEXT_ID[i][j]->read(),0); |
---|
505 | |
---|
506 | Ticache_packet_t packet = ICACHE_RSP_PACKET_ID [i][j]->read(); |
---|
507 | |
---|
508 | for (unsigned int k=0; k<param->iaccess_nb_instruction[i]; k++) |
---|
509 | { |
---|
510 | Ticache_instruction_t inst = ICACHE_RSP_INSTRUCTION[i][j][k]->read(); |
---|
511 | cout << "instruction [" << k << "] : " << std::hex << inst << std::dec << endl; |
---|
512 | |
---|
513 | TEST((inst>>16) , 0x1500); // copdop nop |
---|
514 | TEST((inst&0xffff) , ((0xffff ^ (packet+k))+1)); // packet in CA2 |
---|
515 | } |
---|
516 | |
---|
517 | } |
---|
518 | } |
---|
519 | |
---|
520 | } while (((packet_req<<2)< addr_max) or |
---|
521 | ((packet_rsp<<2)< addr_max)); |
---|
522 | |
---|
523 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
524 | { |
---|
525 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
526 | ICACHE_REQ_VAL [i][j]->write(0); |
---|
527 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
528 | ICACHE_RSP_ACK [i][j]->write(1); |
---|
529 | } |
---|
530 | |
---|
531 | sc_start(50); |
---|
532 | |
---|
533 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
534 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
535 | ICACHE_RSP_ACK [i][j]->write(0); |
---|
536 | |
---|
537 | cout << "Test : icache - bus error" << endl; |
---|
538 | |
---|
539 | // 1) in not valid segment |
---|
540 | ICACHE_REQ_VAL [0][0]->write(1); |
---|
541 | ICACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
542 | ICACHE_REQ_ADDRESS [0][0]->write(0xe0000000>>2); |
---|
543 | ICACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
544 | ICACHE_REQ_TYPE [0][0]->write(ICACHE_TYPE_LOAD); |
---|
545 | ICACHE_RSP_ACK [0][0]->write(1); |
---|
546 | do |
---|
547 | { |
---|
548 | sc_start(1); |
---|
549 | } while (ICACHE_REQ_ACK [0][0]->read() == 0); |
---|
550 | ICACHE_REQ_VAL [0][0]->write(0); |
---|
551 | |
---|
552 | sc_start (9); |
---|
553 | TEST(ICACHE_RSP_VAL [0][0]->read(), 0); |
---|
554 | sc_start (1); |
---|
555 | TEST(ICACHE_RSP_VAL [0][0]->read(), 1); |
---|
556 | TEST(ICACHE_RSP_CONTEXT_ID [0][0] ->read(), 0); |
---|
557 | TEST(ICACHE_RSP_PACKET_ID [0][0] ->read(), 21); |
---|
558 | TEST(ICACHE_RSP_INSTRUCTION [0][0][0]->read(), 0xe0000000); |
---|
559 | TEST(ICACHE_RSP_ERROR [0][0] ->read(), ICACHE_ERROR_BUS_ERROR); |
---|
560 | sc_start (1); |
---|
561 | TEST(ICACHE_RSP_VAL [0][0]->read(), 0); |
---|
562 | |
---|
563 | sc_start (10); |
---|
564 | |
---|
565 | // 2) in valid segment but not memory |
---|
566 | ICACHE_REQ_VAL [0][0]->write(1); |
---|
567 | ICACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
568 | ICACHE_REQ_ADDRESS [0][0]->write(0xa0000000>>2); |
---|
569 | ICACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
570 | ICACHE_REQ_TYPE [0][0]->write(ICACHE_TYPE_LOAD); |
---|
571 | ICACHE_RSP_ACK [0][0]->write(1); |
---|
572 | do |
---|
573 | { |
---|
574 | sc_start(1); |
---|
575 | } while (ICACHE_REQ_ACK [0][0]->read() == 0); |
---|
576 | ICACHE_REQ_VAL [0][0]->write(0); |
---|
577 | |
---|
578 | sc_start (9); |
---|
579 | TEST(ICACHE_RSP_VAL [0][0]->read(), 0); |
---|
580 | sc_start (1); |
---|
581 | TEST(ICACHE_RSP_VAL [0][0]->read(), 1); |
---|
582 | TEST(ICACHE_RSP_CONTEXT_ID [0][0] ->read(), 0); |
---|
583 | TEST(ICACHE_RSP_PACKET_ID [0][0] ->read(), 21); |
---|
584 | TEST(ICACHE_RSP_INSTRUCTION [0][0][0]->read(), 0xa0000000); |
---|
585 | TEST(ICACHE_RSP_ERROR [0][0] ->read(), ICACHE_ERROR_BUS_ERROR); |
---|
586 | sc_start (1); |
---|
587 | TEST(ICACHE_RSP_VAL [0][0]->read(), 0); |
---|
588 | ICACHE_RSP_ACK [0][0]->write(0); |
---|
589 | } |
---|
590 | |
---|
591 | //============================================================================== |
---|
592 | //===== [ TTY ]================================================================= |
---|
593 | //============================================================================== |
---|
594 | if (_TEST_TTY_) |
---|
595 | { |
---|
596 | cout << "Test : TTY" << endl; |
---|
597 | |
---|
598 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
599 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
600 | { |
---|
601 | DCACHE_REQ_VAL [i][j]->write(1); |
---|
602 | DCACHE_REQ_CONTEXT_ID [i][j]->write(0); |
---|
603 | DCACHE_REQ_PACKET_ID [i][j]->write(0); |
---|
604 | DCACHE_REQ_ADDRESS [i][j]->write(tty_address[0]+(2<<2)); |
---|
605 | DCACHE_REQ_TYPE [i][j]->write(DCACHE_TYPE_STORE_32); |
---|
606 | DCACHE_REQ_WDATA [i][j]->write(0xdeadbeef); |
---|
607 | } |
---|
608 | |
---|
609 | sc_start(1); |
---|
610 | for (uint32_t i=0; i<param->nb_entity; i++) |
---|
611 | for (uint32_t j=0; j<param->icache_dedicated_nb_port [i]; j++) |
---|
612 | DCACHE_REQ_VAL [i][j]->write(0); |
---|
613 | |
---|
614 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
615 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_STORE_8); |
---|
616 | DCACHE_REQ_ADDRESS [0][0]->write(tty_address[0]); |
---|
617 | |
---|
618 | char msg1 [] = "kane is back\n"; |
---|
619 | |
---|
620 | for (uint32_t i=0; i<strlen(msg1); i++) |
---|
621 | do |
---|
622 | { |
---|
623 | DCACHE_REQ_WDATA [0][0]->write(msg1[i]); |
---|
624 | sc_start(1); |
---|
625 | } while (not DCACHE_REQ_ACK [0][0]->read()); |
---|
626 | |
---|
627 | |
---|
628 | DCACHE_REQ_ADDRESS [0][0]->write(tty_address[0]+(2<<4)); |
---|
629 | char msg2 [] = "La Technologie au service de la paix\nEt au nom de kane !!!!!!!!!"; |
---|
630 | |
---|
631 | for (uint32_t i=0; i<strlen(msg2); i++) |
---|
632 | do |
---|
633 | { |
---|
634 | DCACHE_REQ_WDATA [0][0]->write(msg2[i]); |
---|
635 | sc_start(1); |
---|
636 | } while (not DCACHE_REQ_ACK [0][0]->read()); |
---|
637 | |
---|
638 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
639 | |
---|
640 | cout << "Test : TTY - bus error" << endl; |
---|
641 | |
---|
642 | // 1) bad access : load |
---|
643 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
644 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
645 | DCACHE_REQ_ADDRESS [0][0]->write(0xa0000000); |
---|
646 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
647 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_32); |
---|
648 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
649 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
650 | do |
---|
651 | { |
---|
652 | sc_start(1); |
---|
653 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
654 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
655 | |
---|
656 | sc_start (9); |
---|
657 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
658 | sc_start (1); |
---|
659 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
660 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
661 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
662 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xa0000000); |
---|
663 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_BUS_ERROR); |
---|
664 | sc_start (1); |
---|
665 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
666 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
667 | |
---|
668 | // 2) bad register |
---|
669 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
670 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
671 | DCACHE_REQ_ADDRESS [0][0]->write(0xa000000c); |
---|
672 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
673 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_STORE_8); |
---|
674 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
675 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
676 | do |
---|
677 | { |
---|
678 | sc_start(1); |
---|
679 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
680 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
681 | |
---|
682 | sc_start (9); |
---|
683 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
684 | sc_start (1); |
---|
685 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
686 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
687 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
688 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xa000000c); |
---|
689 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_BUS_ERROR); |
---|
690 | sc_start (1); |
---|
691 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
692 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
693 | |
---|
694 | |
---|
695 | // 3) bad tty number |
---|
696 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
697 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
698 | DCACHE_REQ_ADDRESS [0][0]->write(0xa0000040); |
---|
699 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
700 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_STORE_8); |
---|
701 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
702 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
703 | do |
---|
704 | { |
---|
705 | sc_start(1); |
---|
706 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
707 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
708 | |
---|
709 | sc_start (9); |
---|
710 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
711 | sc_start (1); |
---|
712 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
713 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
714 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
715 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xa0000040); |
---|
716 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_BUS_ERROR); |
---|
717 | sc_start (1); |
---|
718 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
719 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
720 | } |
---|
721 | |
---|
722 | //============================================================================== |
---|
723 | //===== [ RAMLOCK ]============================================================= |
---|
724 | //============================================================================== |
---|
725 | if (_TEST_RAMLOCK_) |
---|
726 | { |
---|
727 | cout << "Test : RAMLOCK" << endl; |
---|
728 | |
---|
729 | // Test if lock : no |
---|
730 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
731 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
732 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
733 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000003); |
---|
734 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_8); |
---|
735 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
736 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
737 | // Wait ack |
---|
738 | do |
---|
739 | { |
---|
740 | sc_start(1); |
---|
741 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
742 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
743 | |
---|
744 | sc_start (9); |
---|
745 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
746 | sc_start (1); |
---|
747 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
748 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
749 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
750 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0x00000000); |
---|
751 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
752 | sc_start (1); |
---|
753 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
754 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
755 | |
---|
756 | // Test if lock : yes |
---|
757 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
758 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
759 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
760 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000003); |
---|
761 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_8); |
---|
762 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
763 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
764 | // Wait ack |
---|
765 | do |
---|
766 | { |
---|
767 | sc_start(1); |
---|
768 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
769 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
770 | |
---|
771 | sc_start (9); |
---|
772 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
773 | sc_start (1); |
---|
774 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
775 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
776 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
777 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0x00000001); |
---|
778 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
779 | sc_start (1); |
---|
780 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
781 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
782 | |
---|
783 | // Test if lock : no |
---|
784 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
785 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
786 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
787 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000004); |
---|
788 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_8); |
---|
789 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
790 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
791 | // Wait ack |
---|
792 | do |
---|
793 | { |
---|
794 | sc_start(1); |
---|
795 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
796 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
797 | |
---|
798 | sc_start (9); |
---|
799 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
800 | sc_start (1); |
---|
801 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
802 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
803 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
804 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0x00000000); |
---|
805 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
806 | sc_start (1); |
---|
807 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
808 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
809 | |
---|
810 | // Test if lock : yes |
---|
811 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
812 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
813 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
814 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000004); |
---|
815 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_8); |
---|
816 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
817 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
818 | // Wait ack |
---|
819 | do |
---|
820 | { |
---|
821 | sc_start(1); |
---|
822 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
823 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
824 | |
---|
825 | sc_start (9); |
---|
826 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
827 | sc_start (1); |
---|
828 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
829 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
830 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
831 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0x00000001); |
---|
832 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
833 | sc_start (1); |
---|
834 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
835 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
836 | |
---|
837 | |
---|
838 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
839 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
840 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
841 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000003); |
---|
842 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_STORE_8); |
---|
843 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
844 | |
---|
845 | sc_start (1); |
---|
846 | |
---|
847 | // Test if lock : no |
---|
848 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
849 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
850 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
851 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000003); |
---|
852 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_8); |
---|
853 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
854 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
855 | // Wait ack |
---|
856 | do |
---|
857 | { |
---|
858 | sc_start(1); |
---|
859 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
860 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
861 | |
---|
862 | sc_start (9); |
---|
863 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
864 | sc_start (1); |
---|
865 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
866 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
867 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
868 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0x00000000); |
---|
869 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
870 | sc_start (1); |
---|
871 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
872 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
873 | |
---|
874 | // Test if lock : yes |
---|
875 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
876 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
877 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
878 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000003); |
---|
879 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_8); |
---|
880 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
881 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
882 | // Wait ack |
---|
883 | do |
---|
884 | { |
---|
885 | sc_start(1); |
---|
886 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
887 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
888 | |
---|
889 | sc_start (9); |
---|
890 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
891 | sc_start (1); |
---|
892 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
893 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
894 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
895 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0x00000001); |
---|
896 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
897 | sc_start (1); |
---|
898 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
899 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
900 | |
---|
901 | |
---|
902 | sc_start (5); |
---|
903 | // Bus Error |
---|
904 | |
---|
905 | // 1) size access |
---|
906 | // Test if lock : yes |
---|
907 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
908 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
909 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
910 | DCACHE_REQ_ADDRESS [0][0]->write(0xb0000003); |
---|
911 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_16); |
---|
912 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
913 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
914 | // Wait ack |
---|
915 | do |
---|
916 | { |
---|
917 | sc_start(1); |
---|
918 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
919 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
920 | |
---|
921 | sc_start (9); |
---|
922 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
923 | sc_start (1); |
---|
924 | TEST(DCACHE_RSP_VAL [0][0]->read(), 1); |
---|
925 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
926 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
927 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xb0000003); |
---|
928 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_BUS_ERROR); |
---|
929 | sc_start (1); |
---|
930 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
931 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
932 | |
---|
933 | } |
---|
934 | |
---|
935 | //============================================================================== |
---|
936 | //===== [ MEMORY ]============================================================== |
---|
937 | //============================================================================== |
---|
938 | if (_TEST_DMEMORY_) |
---|
939 | { |
---|
940 | cout << "Test : MEMORY" << endl; |
---|
941 | |
---|
942 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
943 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
944 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
945 | DCACHE_REQ_ADDRESS [0][0]->write(0x10000100); |
---|
946 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_STORE_32); |
---|
947 | DCACHE_REQ_WDATA [0][0]->write(0xdeadbeef); |
---|
948 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
949 | // Wait ack |
---|
950 | do |
---|
951 | { |
---|
952 | sc_start(1); |
---|
953 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
954 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
955 | |
---|
956 | |
---|
957 | |
---|
958 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
959 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
960 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
961 | DCACHE_REQ_ADDRESS [0][0]->write(0x10000100); |
---|
962 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_32); |
---|
963 | DCACHE_REQ_WDATA [0][0]->write(0x77777777); |
---|
964 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
965 | // Wait ack |
---|
966 | do |
---|
967 | { |
---|
968 | sc_start(1); |
---|
969 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
970 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
971 | |
---|
972 | while (DCACHE_RSP_VAL [0][0]->read() == 0) |
---|
973 | sc_start (1); |
---|
974 | |
---|
975 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
976 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
977 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xdeadbeef); |
---|
978 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
979 | sc_start (1); |
---|
980 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
981 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
982 | |
---|
983 | |
---|
984 | |
---|
985 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
986 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
987 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
988 | DCACHE_REQ_ADDRESS [0][0]->write(0x10000100); |
---|
989 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_16); |
---|
990 | DCACHE_REQ_WDATA [0][0]->write(0x77777777); |
---|
991 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
992 | // Wait ack |
---|
993 | do |
---|
994 | { |
---|
995 | sc_start(1); |
---|
996 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
997 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
998 | |
---|
999 | while (DCACHE_RSP_VAL [0][0]->read() == 0) |
---|
1000 | sc_start (1); |
---|
1001 | |
---|
1002 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
1003 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
1004 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xdeaddead); |
---|
1005 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
1006 | sc_start (1); |
---|
1007 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
1008 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
1009 | |
---|
1010 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
1011 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
1012 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
1013 | DCACHE_REQ_ADDRESS [0][0]->write(0x10000102); |
---|
1014 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_16); |
---|
1015 | DCACHE_REQ_WDATA [0][0]->write(0x77777777); |
---|
1016 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
1017 | // Wait ack |
---|
1018 | do |
---|
1019 | { |
---|
1020 | sc_start(1); |
---|
1021 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
1022 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
1023 | |
---|
1024 | while (DCACHE_RSP_VAL [0][0]->read() == 0) |
---|
1025 | sc_start (1); |
---|
1026 | |
---|
1027 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
1028 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
1029 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 0xbeefbeef); |
---|
1030 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
1031 | sc_start (1); |
---|
1032 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
1033 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
1034 | |
---|
1035 | } |
---|
1036 | |
---|
1037 | //============================================================================== |
---|
1038 | //===== [ SIM2OS ]============================================================== |
---|
1039 | //============================================================================== |
---|
1040 | if (_TEST_SIM2OS_) |
---|
1041 | { |
---|
1042 | cout << "Test : SIM2OS" << endl; |
---|
1043 | |
---|
1044 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
1045 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
1046 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
1047 | DCACHE_REQ_ADDRESS [0][0]->write(0xc0000000); |
---|
1048 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_STORE_32); |
---|
1049 | DCACHE_REQ_WDATA [0][0]->write(SERVICE_CLOCK); |
---|
1050 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
1051 | // Wait ack |
---|
1052 | do |
---|
1053 | { |
---|
1054 | sc_start(1); |
---|
1055 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
1056 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
1057 | |
---|
1058 | |
---|
1059 | |
---|
1060 | DCACHE_REQ_VAL [0][0]->write(1); |
---|
1061 | DCACHE_REQ_CONTEXT_ID [0][0]->write(0); |
---|
1062 | DCACHE_REQ_PACKET_ID [0][0]->write(21); |
---|
1063 | DCACHE_REQ_ADDRESS [0][0]->write(0xc0000004); |
---|
1064 | DCACHE_REQ_TYPE [0][0]->write(DCACHE_TYPE_LOAD_32); |
---|
1065 | DCACHE_REQ_WDATA [0][0]->write(0x77777777); |
---|
1066 | DCACHE_RSP_ACK [0][0]->write(1); |
---|
1067 | // Wait ack |
---|
1068 | do |
---|
1069 | { |
---|
1070 | sc_start(1); |
---|
1071 | } while (DCACHE_REQ_ACK [0][0]->read() == 0); |
---|
1072 | DCACHE_REQ_VAL [0][0]->write(0); |
---|
1073 | |
---|
1074 | while (DCACHE_RSP_VAL [0][0]->read() == 0) |
---|
1075 | sc_start (1); |
---|
1076 | |
---|
1077 | TEST(DCACHE_RSP_CONTEXT_ID [0][0]->read(), 0); |
---|
1078 | TEST(DCACHE_RSP_PACKET_ID [0][0]->read(), 21); |
---|
1079 | TEST(DCACHE_RSP_RDATA [0][0]->read(), 354); // if all test is activate |
---|
1080 | TEST(DCACHE_RSP_ERROR [0][0]->read(), DCACHE_ERROR_NONE); |
---|
1081 | sc_start (1); |
---|
1082 | TEST(DCACHE_RSP_VAL [0][0]->read(), 0); |
---|
1083 | DCACHE_RSP_ACK [0][0]->write(0); |
---|
1084 | |
---|
1085 | |
---|
1086 | } |
---|
1087 | |
---|
1088 | //============================================================================== |
---|
1089 | //===== [ END TEST ]============================================================ |
---|
1090 | //============================================================================== |
---|
1091 | |
---|
1092 | cout << "<main> Press <Enter> to stop the test" << endl; |
---|
1093 | getchar(); |
---|
1094 | |
---|
1095 | delete CLOCK ; |
---|
1096 | delete NRESET; |
---|
1097 | |
---|
1098 | for (uint32_t i=0; i<nb_entity; i++) |
---|
1099 | { |
---|
1100 | for (uint32_t j=0; j<icache_nb_port[i]; j++) |
---|
1101 | { |
---|
1102 | delete ICACHE_REQ_VAL [i][j]; |
---|
1103 | delete ICACHE_REQ_ACK [i][j]; |
---|
1104 | delete ICACHE_REQ_CONTEXT_ID [i][j]; |
---|
1105 | delete ICACHE_REQ_PACKET_ID [i][j]; |
---|
1106 | delete ICACHE_REQ_ADDRESS [i][j]; |
---|
1107 | delete ICACHE_REQ_TYPE [i][j]; |
---|
1108 | delete ICACHE_RSP_VAL [i][j]; |
---|
1109 | delete ICACHE_RSP_ACK [i][j]; |
---|
1110 | delete ICACHE_RSP_CONTEXT_ID [i][j]; |
---|
1111 | delete ICACHE_RSP_PACKET_ID [i][j]; |
---|
1112 | delete ICACHE_RSP_ERROR [i][j]; |
---|
1113 | |
---|
1114 | for (uint32_t k=0; k<iaccess_nb_instruction[i]; k++) |
---|
1115 | delete ICACHE_RSP_INSTRUCTION [i][j][k]; |
---|
1116 | |
---|
1117 | delete [] ICACHE_RSP_INSTRUCTION [i][j]; |
---|
1118 | } |
---|
1119 | delete [] ICACHE_REQ_VAL [i]; |
---|
1120 | delete [] ICACHE_REQ_ACK [i]; |
---|
1121 | delete [] ICACHE_REQ_CONTEXT_ID [i]; |
---|
1122 | delete [] ICACHE_REQ_PACKET_ID [i]; |
---|
1123 | delete [] ICACHE_REQ_ADDRESS [i]; |
---|
1124 | delete [] ICACHE_REQ_TYPE [i]; |
---|
1125 | delete [] ICACHE_RSP_VAL [i]; |
---|
1126 | delete [] ICACHE_RSP_ACK [i]; |
---|
1127 | delete [] ICACHE_RSP_CONTEXT_ID [i]; |
---|
1128 | delete [] ICACHE_RSP_PACKET_ID [i]; |
---|
1129 | delete [] ICACHE_RSP_ERROR [i]; |
---|
1130 | delete [] ICACHE_RSP_INSTRUCTION [i]; |
---|
1131 | } |
---|
1132 | |
---|
1133 | delete [] ICACHE_REQ_VAL ; |
---|
1134 | delete [] ICACHE_REQ_ACK ; |
---|
1135 | delete [] ICACHE_REQ_CONTEXT_ID ; |
---|
1136 | delete [] ICACHE_REQ_PACKET_ID ; |
---|
1137 | delete [] ICACHE_REQ_ADDRESS ; |
---|
1138 | delete [] ICACHE_REQ_TYPE ; |
---|
1139 | delete [] ICACHE_RSP_VAL ; |
---|
1140 | delete [] ICACHE_RSP_ACK ; |
---|
1141 | delete [] ICACHE_RSP_CONTEXT_ID ; |
---|
1142 | delete [] ICACHE_RSP_PACKET_ID ; |
---|
1143 | delete [] ICACHE_RSP_INSTRUCTION; |
---|
1144 | delete [] ICACHE_RSP_ERROR ; |
---|
1145 | |
---|
1146 | for (uint32_t i=0; i<nb_entity; i++) |
---|
1147 | { |
---|
1148 | for (uint32_t j=0; j<icache_nb_port[i]; j++) |
---|
1149 | { |
---|
1150 | delete DCACHE_REQ_VAL [i][j]; |
---|
1151 | delete DCACHE_REQ_ACK [i][j]; |
---|
1152 | delete DCACHE_REQ_CONTEXT_ID [i][j]; |
---|
1153 | delete DCACHE_REQ_PACKET_ID [i][j]; |
---|
1154 | delete DCACHE_REQ_ADDRESS [i][j]; |
---|
1155 | delete DCACHE_REQ_TYPE [i][j]; |
---|
1156 | delete DCACHE_REQ_WDATA [i][j]; |
---|
1157 | delete DCACHE_RSP_VAL [i][j]; |
---|
1158 | delete DCACHE_RSP_ACK [i][j]; |
---|
1159 | delete DCACHE_RSP_CONTEXT_ID [i][j]; |
---|
1160 | delete DCACHE_RSP_PACKET_ID [i][j]; |
---|
1161 | delete DCACHE_RSP_RDATA [i][j]; |
---|
1162 | delete DCACHE_RSP_ERROR [i][j]; |
---|
1163 | } |
---|
1164 | |
---|
1165 | delete [] DCACHE_REQ_VAL [i]; |
---|
1166 | delete [] DCACHE_REQ_ACK [i]; |
---|
1167 | delete [] DCACHE_REQ_CONTEXT_ID [i]; |
---|
1168 | delete [] DCACHE_REQ_PACKET_ID [i]; |
---|
1169 | delete [] DCACHE_REQ_ADDRESS [i]; |
---|
1170 | delete [] DCACHE_REQ_TYPE [i]; |
---|
1171 | delete [] DCACHE_REQ_WDATA [i]; |
---|
1172 | delete [] DCACHE_RSP_VAL [i]; |
---|
1173 | delete [] DCACHE_RSP_ACK [i]; |
---|
1174 | delete [] DCACHE_RSP_CONTEXT_ID [i]; |
---|
1175 | delete [] DCACHE_RSP_PACKET_ID [i]; |
---|
1176 | delete [] DCACHE_RSP_RDATA [i]; |
---|
1177 | delete [] DCACHE_RSP_ERROR [i]; |
---|
1178 | } |
---|
1179 | |
---|
1180 | delete [] DCACHE_REQ_VAL ; |
---|
1181 | delete [] DCACHE_REQ_ACK ; |
---|
1182 | delete [] DCACHE_REQ_CONTEXT_ID ; |
---|
1183 | delete [] DCACHE_REQ_PACKET_ID ; |
---|
1184 | delete [] DCACHE_REQ_ADDRESS ; |
---|
1185 | delete [] DCACHE_REQ_TYPE ; |
---|
1186 | delete [] DCACHE_REQ_WDATA ; |
---|
1187 | delete [] DCACHE_RSP_VAL ; |
---|
1188 | delete [] DCACHE_RSP_ACK ; |
---|
1189 | delete [] DCACHE_RSP_CONTEXT_ID ; |
---|
1190 | delete [] DCACHE_RSP_PACKET_ID ; |
---|
1191 | delete [] DCACHE_RSP_RDATA ; |
---|
1192 | delete [] DCACHE_RSP_ERROR ; |
---|
1193 | |
---|
1194 | delete env; |
---|
1195 | |
---|
1196 | delete param; |
---|
1197 | delete segtable; |
---|
1198 | |
---|
1199 | delete [] ramlock_address; |
---|
1200 | delete [] nb_lock; |
---|
1201 | |
---|
1202 | delete [] name_tty [0]; |
---|
1203 | delete [] name_tty; |
---|
1204 | delete [] tty_address; |
---|
1205 | delete [] nb_tty; |
---|
1206 | |
---|
1207 | delete [] cache_shared_nb_line ; |
---|
1208 | delete [] cache_shared_size_line ; |
---|
1209 | delete [] cache_shared_size_word ; |
---|
1210 | delete [] cache_shared_associativity; |
---|
1211 | delete [] cache_shared_hit_latence ; |
---|
1212 | delete [] cache_shared_miss_penality; |
---|
1213 | delete [] icache_nb_level ; |
---|
1214 | delete [] icache_nb_port ; |
---|
1215 | delete [] icache_nb_line [0]; |
---|
1216 | delete [] icache_size_line [0]; |
---|
1217 | delete [] icache_size_word [0]; |
---|
1218 | delete [] icache_associativity [0]; |
---|
1219 | delete [] icache_hit_latence [0]; |
---|
1220 | delete [] icache_miss_penality [0]; |
---|
1221 | delete [] icache_nb_line [1]; |
---|
1222 | delete [] icache_size_line [1]; |
---|
1223 | delete [] icache_size_word [1]; |
---|
1224 | delete [] icache_associativity [1]; |
---|
1225 | delete [] icache_hit_latence [1]; |
---|
1226 | delete [] icache_miss_penality [1]; |
---|
1227 | delete [] icache_nb_line ; |
---|
1228 | delete [] icache_size_line ; |
---|
1229 | delete [] icache_size_word ; |
---|
1230 | delete [] icache_associativity ; |
---|
1231 | delete [] icache_hit_latence ; |
---|
1232 | delete [] icache_miss_penality ; |
---|
1233 | delete [] dcache_nb_level ; |
---|
1234 | delete [] dcache_nb_port ; |
---|
1235 | delete [] dcache_nb_line [0]; |
---|
1236 | delete [] dcache_size_line [0]; |
---|
1237 | delete [] dcache_size_word [0]; |
---|
1238 | delete [] dcache_associativity [0]; |
---|
1239 | delete [] dcache_hit_latence [0]; |
---|
1240 | delete [] dcache_miss_penality [0]; |
---|
1241 | delete [] dcache_nb_line [1]; |
---|
1242 | delete [] dcache_size_line [1]; |
---|
1243 | delete [] dcache_size_word [1]; |
---|
1244 | delete [] dcache_associativity [1]; |
---|
1245 | delete [] dcache_hit_latence [1]; |
---|
1246 | delete [] dcache_miss_penality [1]; |
---|
1247 | delete [] dcache_nb_line ; |
---|
1248 | delete [] dcache_size_line ; |
---|
1249 | delete [] dcache_size_word ; |
---|
1250 | delete [] dcache_associativity ; |
---|
1251 | delete [] dcache_hit_latence ; |
---|
1252 | delete [] dcache_miss_penality ; |
---|
1253 | |
---|
1254 | delete [] iaccess_nb_context ; |
---|
1255 | delete [] iaccess_nb_instruction; |
---|
1256 | delete [] iaccess_nb_packet ; |
---|
1257 | delete [] iaccess_size_address ; |
---|
1258 | delete [] iaccess_size_data ; |
---|
1259 | delete [] daccess_nb_context ; |
---|
1260 | delete [] daccess_nb_packet ; |
---|
1261 | delete [] daccess_size_address ; |
---|
1262 | delete [] daccess_size_data ; |
---|
1263 | |
---|
1264 | delete [] buffer_irsp_size; |
---|
1265 | delete [] buffer_drsp_size; |
---|
1266 | } |
---|
1267 | cout << "<main> End" << endl; |
---|
1268 | |
---|
1269 | return EXIT_SUCCESS; |
---|
1270 | } |
---|