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