OpenCores
URL https://opencores.org/ocsvn/apbtoaes128/apbtoaes128/trunk

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [bfm_ecb/] [aes_bfm_encryption_dma_ecb.h] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 redbear
//////////////////////////////////////////////////////////////////
2
////
3
////
4
////    AES CORE BLOCK
5
////
6
////
7
////
8
//// This file is part of the APB to AES128 project
9
////
10
//// http://www.opencores.org/cores/apbtoaes128/
11
////
12
////
13
////
14
//// Description
15
////
16
//// Implementation of APB IP core according to
17
////
18
//// aes128_spec IP core specification document.
19
////
20
////
21
////
22
//// To Do: Things are right here but always all block can suffer changes
23
////
24
////
25
////
26
////
27
////
28
//// Author(s): - Felipe Fernandes Da Costa, fefe2560@gmail.com
29
////
30
///////////////////////////////////////////////////////////////// 
31
////
32
////
33
//// Copyright (C) 2009 Authors and OPENCORES.ORG
34
////
35
////
36
////
37
//// This source file may be used and distributed without
38
////
39
//// restriction provided that this copyright statement is not
40
////
41
//// removed from the file and that any derivative work contains
42
//// the original copyright notice and the associated disclaimer.
43
////
44
////
45
//// This source file is free software; you can redistribute it
46
////
47
//// and/or modify it under the terms of the GNU Lesser General
48
////
49
//// Public License as published by the Free Software Foundation;
50
//// either version 2.1 of the License, or (at your option) any
51
////
52
//// later version.
53
////
54
////
55
////
56
//// This source is distributed in the hope that it will be
57
////
58
//// useful, but WITHOUT ANY WARRANTY; without even the implied
59
////
60
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
61
////
62
//// PURPOSE. See the GNU Lesser General Public License for more
63
//// details.
64
////
65
////
66
////
67
//// You should have received a copy of the GNU Lesser General
68
////
69
//// Public License along with this source; if not, download it
70
////
71
//// from http://www.opencores.org/lgpl.shtml
72
////
73
////
74
///////////////////////////////////////////////////////////////////
75
static int aes_bfm_encryption_ecb_dma_calltf(char*user_data)
76
{
77
 
78
        vpiHandle PRESETn = vpi_handle_by_name("AES_GLADIC_tb.PRESETn", NULL);
79
        vpiHandle PWDATA = vpi_handle_by_name("AES_GLADIC_tb.PWDATA", NULL);
80
        vpiHandle PENABLE = vpi_handle_by_name("AES_GLADIC_tb.PENABLE", NULL);
81
        vpiHandle PSEL = vpi_handle_by_name("AES_GLADIC_tb.PSEL", NULL);
82
        vpiHandle PWRITE = vpi_handle_by_name("AES_GLADIC_tb.PWRITE", NULL);
83
        vpiHandle PADDR = vpi_handle_by_name("AES_GLADIC_tb.PADDR", NULL);
84
        vpiHandle PRDATA = vpi_handle_by_name("AES_GLADIC_tb.PRDATA", NULL);
85
        vpiHandle PREADY = vpi_handle_by_name("AES_GLADIC_tb.PREADY", NULL);
86
        vpiHandle PSLVERR = vpi_handle_by_name("AES_GLADIC_tb.PSLVERR", NULL);
87
        vpiHandle int_ccf = vpi_handle_by_name("AES_GLADIC_tb.int_ccf", NULL);
88
        vpiHandle int_err = vpi_handle_by_name("AES_GLADIC_tb.int_err", NULL);
89
        vpiHandle dma_req_wr = vpi_handle_by_name("AES_GLADIC_tb.dma_req_wr", NULL);
90
        vpiHandle dma_req_rd = vpi_handle_by_name("AES_GLADIC_tb.dma_req_rd", NULL);
91
 
92
        std::random_device rd;
93
        std::uniform_int_distribution<long int> data_in(0,4294967295);
94
 
95
        v_ecb.format=vpiIntVal;
96
 
97
        vpi_get_value(PRESETn, &v_ecb);
98
 
99
 
100
        //printf("%i\n",STATE);
101
 
102
 
103
        if(type_bfm == ECB_ENCRYPTION_DMA && v_ecb.value.integer == 1)
104
        {
105
 
106
                switch(STATE)
107
                {
108
 
109
                  case IDLE:
110
 
111
                                if(PACKETS_GENERATED >= MAX_ITERATIONS)
112
                                {
113
 
114
                                        STATE = IDLE;
115
                                        type_bfm = 0;
116
 
117
                                }else
118
                                {
119
                                        STATE = WRITE;
120
 
121
                                        counter = 0;
122
 
123
 
124
                                        v_ecb.value.integer = 0;
125
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
126
 
127
                                        v_ecb.value.integer = vector_address[0];
128
                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
129
 
130
                                        v_ecb.value.integer = 0;
131
                                        vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);
132
 
133
                                        v_ecb.value.integer = 1;
134
                                        vpi_put_value(PWRITE, &v_ecb, NULL, vpiNoDelay);
135
 
136
                                        v_ecb.value.integer = 1;
137
                                        vpi_put_value(PSEL, &v_ecb, NULL, vpiNoDelay);
138
                                }
139
 
140
                  break;
141
 
142
                  case WRITE:
143
 
144
 
145
 
146
                        v_ecb.value.integer = 1;
147
                        vpi_put_value(PSEL, &v_ecb, NULL, vpiNoDelay);
148
 
149
                        if(counter == 0)
150
                        {
151
                                counter_write++;
152
                                counter++;
153
 
154
                                v_ecb.value.integer = 1;
155
                                vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
156
 
157
 
158
                        }else if(counter == 1)
159
                        {
160
 
161
 
162
 
163
                                t_ecb.type = vpiScaledRealTime;
164
                                t_ecb.real = 0;
165
                                v_ecb.format=vpiIntVal;
166
 
167
                                v_ecb.value.integer = 0;
168
                                vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
169
 
170
 
171
                                if(counter_write < 9)
172
                                {
173
 
174
                                        v_ecb.value.integer = vector_address[counter_write];
175
 
176
                                        vpi_put_value(PADDR, &v_ecb, &t_ecb, vpiTransportDelay);
177
                                        //vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
178
 
179
                                        if(FIPS_ENABLE == FIPS)
180
                                        {
181
 
182
                                                if(vector_address[counter_write] == ADDR_AES_KEYR3 || vector_address[counter_write] == ADDR_AES_IVR3)
183
                                                {
184
                                                        a = a | KEY_FIPS_NOT_DERIVATED[0];
185
                                                        a = a << 8;
186
                                                        a = a | KEY_FIPS_NOT_DERIVATED[1];
187
                                                        a = a << 8;
188
                                                        a = a | KEY_FIPS_NOT_DERIVATED[2];
189
                                                        a = a << 8;
190
                                                        a = a | KEY_FIPS_NOT_DERIVATED[3];
191
                                                        v_ecb.value.integer = a;
192
                                                }
193
 
194
 
195
                                                if(vector_address[counter_write] == ADDR_AES_KEYR2 || vector_address[counter_write] == ADDR_AES_IVR2)
196
                                                {
197
                                                        b = b | KEY_FIPS_NOT_DERIVATED[4];
198
                                                        b = b << 8;
199
                                                        b = b | KEY_FIPS_NOT_DERIVATED[5];
200
                                                        b = b << 8;
201
                                                        b = b | KEY_FIPS_NOT_DERIVATED[6];
202
                                                        b = b << 8;
203
                                                        b = b | KEY_FIPS_NOT_DERIVATED[7];
204
                                                        v_ecb.value.integer = b;
205
                                                }
206
 
207
                                                if(vector_address[counter_write] == ADDR_AES_KEYR1 || vector_address[counter_write] == ADDR_AES_IVR1)
208
                                                {
209
 
210
                                                        c = c | KEY_FIPS_NOT_DERIVATED[8];
211
                                                        c = c << 8;
212
                                                        c = c | KEY_FIPS_NOT_DERIVATED[9];
213
                                                        c = c << 8;
214
                                                        c = c | KEY_FIPS_NOT_DERIVATED[10];
215
                                                        c = c << 8;
216
                                                        c = c | KEY_FIPS_NOT_DERIVATED[11];
217
                                                        v_ecb.value.integer = c;
218
 
219
                                                }
220
 
221
                                                if(vector_address[counter_write] == ADDR_AES_KEYR0 || vector_address[counter_write] == ADDR_AES_IVR0)
222
                                                {
223
                                                        d = d | KEY_FIPS_NOT_DERIVATED[12];
224
                                                        d = d << 8;
225
                                                        d = d | KEY_FIPS_NOT_DERIVATED[13];
226
                                                        d = d << 8;
227
                                                        d = d | KEY_FIPS_NOT_DERIVATED[14];
228
                                                        d = d << 8;
229
                                                        d = d | KEY_FIPS_NOT_DERIVATED[15];
230
                                                        v_ecb.value.integer = d;
231
                                                }
232
 
233
 
234
 
235
                                        }else if(FIPS_ENABLE == RANDOM_DATA)
236
                                        {
237
                                                v_ecb.value.integer = data_in(rd);
238
                                        }
239
 
240
                                        //vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);                                              
241
                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
242
 
243
 
244
                                        a = 0;
245
                                        b = 0;
246
                                        c = 0;
247
                                        d = 0;
248
 
249
 
250
 
251
                                }else if(counter_write == 9)//ENABLE CR
252
                                {
253
 
254 12 redbear
                                        if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA
255
                                        {
256
                                                v_ecb.value.integer = ADDR_AES_CR;
257
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
258 4 redbear
 
259 12 redbear
                                                v_ecb.value.integer = 6145;
260
                                                vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
261 4 redbear
 
262 12 redbear
                                        }else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA
263
                                        {
264
                                                v_ecb.value.integer = ADDR_AES_CR;
265
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
266
 
267
                                                v_ecb.value.integer = 6147;
268
                                                vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
269
 
270
                                        }else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA
271
                                        {
272
                                                v_ecb.value.integer = ADDR_AES_CR;
273
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
274
 
275
                                                v_ecb.value.integer = 6149;
276
                                                vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
277
 
278
                                        }else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA
279
                                        {
280
                                                v_ecb.value.integer = ADDR_AES_CR;
281
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
282
 
283
                                                v_ecb.value.integer = 6151;
284
                                                vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
285
                                        }
286 4 redbear
                                }else if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
287
                                {
288
 
289
                                        v_ecb.value.integer = ADDR_AES_DINR;
290
                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
291
 
292
 
293
                                        if(FIPS_ENABLE == FIPS)
294
                                        {
295
 
296 12 redbear
                                                if(DATATYPE == TYPE_00)
297 4 redbear
                                                {
298
 
299 12 redbear
                                                        if(counter_write == 10)
300
                                                        {
301
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[0];
302
                                                                a = a << 8;
303
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[1];
304
                                                                a = a << 8;
305
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[2];
306
                                                                a = a << 8;
307
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[3];
308
                                                                v_ecb.value.integer = a;
309 4 redbear
 
310 12 redbear
                                                        }else if(counter_write == 11)
311
                                                        {
312
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[4];
313
                                                                b = b << 8;
314
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[5];
315
                                                                b = b << 8;
316
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[6];
317
                                                                b = b << 8;
318
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[7];
319
                                                                v_ecb.value.integer = b;
320 4 redbear
 
321 12 redbear
                                                        }else if(counter_write == 12 )
322
                                                        {
323 4 redbear
 
324 12 redbear
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[8];
325
                                                                c = c << 8;
326
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[9];
327
                                                                c = c << 8;
328
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[10];
329
                                                                c = c << 8;
330
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[11];
331
                                                                v_ecb.value.integer = c;
332
 
333
                                                        }else if(counter_write == 13 )
334
                                                        {
335
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[12];
336
                                                                d = d << 8;
337
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[13];
338
                                                                d = d << 8;
339
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[14];
340
                                                                d = d << 8;
341
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[15];
342
                                                                v_ecb.value.integer = d;
343
 
344
                                                        }
345
 
346
                                                }else if(DATATYPE > TYPE_00)
347 4 redbear
                                                {
348
 
349 12 redbear
 
350
                                                        if(counter_write == 10)
351
                                                        {
352
                                                                a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[0];
353
                                                                a = a << 8;
354
                                                                a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[1];
355
                                                                a = a << 8;
356
                                                                a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[2];
357
                                                                a = a << 8;
358
                                                                a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[3];
359
                                                                v_ecb.value.integer = a;
360
 
361
                                                        }else if(counter_write == 11)
362
                                                        {
363
                                                                b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[4];
364
                                                                b = b << 8;
365
                                                                b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[5];
366
                                                                b = b << 8;
367
                                                                b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[6];
368
                                                                b = b << 8;
369
                                                                b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[7];
370
                                                                v_ecb.value.integer = b;
371
 
372
                                                        }else if(counter_write == 12 )
373
                                                        {
374
 
375
                                                                c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[8];
376
                                                                c = c << 8;
377
                                                                c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[9];
378
                                                                c = c << 8;
379
                                                                c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[10];
380
                                                                c = c << 8;
381
                                                                c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[11];
382
                                                                v_ecb.value.integer = c;
383
 
384
                                                        }else if(counter_write == 13 )
385
                                                        {
386
                                                                d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[12];
387
                                                                d = d << 8;
388
                                                                d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[13];
389
                                                                d = d << 8;
390
                                                                d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[14];
391
                                                                d = d << 8;
392
                                                                d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[15];
393
                                                                v_ecb.value.integer = d;
394
 
395
                                                        }
396
 
397 4 redbear
                                                }
398
 
399
 
400
                                        }else if(FIPS_ENABLE == RANDOM_DATA)
401
                                        {
402
                                                v_ecb.value.integer = data_in(rd);
403
                                        }
404
 
405
                                        //vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);
406
                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
407
 
408
                                        a = 0;
409
                                        b = 0;
410
                                        c = 0;
411
                                        d = 0;
412
 
413
 
414
                                }
415
                                        counter=0;
416
 
417
                        }
418
 
419
 
420
 
421
                                if(counter_write == 14)
422
                                {
423
                                        counter_write = 0;
424
                                        STATE = WAIT_SR;
425
                                }
426
 
427
                  break;
428
 
429
                  case WAIT_SR:
430
 
431
                                v_ecb.value.integer = ADDR_AES_SR;
432
                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
433
 
434
                                v_ecb.value.integer = 0;
435
                                vpi_put_value(PWRITE, &v_ecb, NULL, vpiNoDelay);
436
                                //vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);
437
 
438
 
439
                                if(counter == 0)
440
                                {
441
 
442
                                        counter++;
443
 
444
                                        v_ecb.value.integer = 1;
445
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
446
 
447 9 redbear
                                        v_ecb.value.integer = 0;
448
                                        vpi_get_value(PRDATA,&v_ecb);
449 4 redbear
 
450 9 redbear
                                        if(v_ecb.value.integer == 1)
451
                                        {
452
                                                STATE = READ_DOUTR;
453
 
454
                                                //t_ecb.type = vpiScaledRealTime;
455
                                                //t_ecb.real = 0;
456
                                                //v_ecb.format=vpiIntVal;
457
                                                //v_ecb.value.integer = ADDR_AES_DOUTR;
458
                                                //vpi_put_value(PADDR, &v_ecb, &t_ecb, vpiTransportDelay);
459
                                        }
460
 
461
 
462 4 redbear
                                }else if(counter == 1)
463
                                {
464
                                        v_ecb.value.integer = 0;
465
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
466
 
467
                                        counter=0;
468
 
469
                                }
470
 
471
 
472
                  break;
473
 
474
 
475
                 case READ_DOUTR:
476
 
477
 
478
 
479
                                if(counter == 0)
480
                                {
481
 
482
                                        v_ecb.value.integer = 1;
483
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
484
 
485 5 redbear
                                        counter_read++;
486 4 redbear
                                        counter++;
487
 
488
 
489
 
490
                                }else if(counter == 1)
491
                                {
492
                                        v_ecb.value.integer = 0;
493
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
494
 
495 5 redbear
 
496
                                        if(counter_read < 4)
497
                                        {
498
 
499
                                                v_ecb.value.integer = ADDR_AES_DOUTR;
500
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
501
 
502
                                        }
503
 
504
 
505
                                        if(counter_read == 4)
506
                                        {
507
 
508
                                                v_ecb.value.integer = ADDR_AES_KEYR3;
509
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
510
 
511
                                        }
512
 
513
 
514
                                        if(counter_read == 5)
515
                                        {
516
 
517
                                                v_ecb.value.integer = ADDR_AES_KEYR2;
518
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
519
 
520
                                        }
521
 
522
 
523
 
524
                                        if(counter_read == 6)
525
                                        {
526
 
527
                                                v_ecb.value.integer = ADDR_AES_KEYR1;
528
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
529
 
530
                                        }
531
 
532
 
533
                                        if(counter_read == 7)
534
                                        {
535
 
536
                                                v_ecb.value.integer = ADDR_AES_KEYR0;
537
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
538
 
539
                                        }
540
 
541
 
542
                                        if(counter_read == 8)
543
                                        {
544
 
545
                                                v_ecb.value.integer = ADDR_AES_IVR3;
546
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
547
 
548
                                        }
549
 
550
 
551
                                        if(counter_read == 9)
552
                                        {
553
 
554
                                                v_ecb.value.integer = ADDR_AES_IVR2;
555
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
556
 
557
                                        }
558
 
559
 
560
 
561
                                        if(counter_read == 10)
562
                                        {
563
 
564
                                                v_ecb.value.integer = ADDR_AES_IVR1;
565
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
566
 
567
                                        }
568
 
569
 
570
                                        if(counter_read == 11)
571
                                        {
572
 
573
                                                v_ecb.value.integer = ADDR_AES_IVR0;
574
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
575
 
576
                                        }
577
 
578
 
579 4 redbear
                                        counter = 0;
580
                                }
581
 
582 5 redbear
                                if(counter_read == 12)
583 4 redbear
                                {
584
                                        STATE = RESET_SR;
585 5 redbear
                                        counter_read = 0;
586 4 redbear
                                }
587
 
588
                 break;
589
 
590
                case RESET_SR:
591
 
592
                                v_ecb.value.integer = 1;
593
                                vpi_put_value(PWRITE, &v_ecb, NULL, vpiNoDelay);
594
 
595
                                v_ecb.value.integer = 1;
596
                                vpi_put_value(PSEL, &v_ecb, NULL, vpiNoDelay);
597
 
598
                                v_ecb.value.integer = 0;
599
                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
600
 
601
                                v_ecb.value.integer = 128;
602
                                vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);
603
 
604
 
605
                                if(counter == 0)
606
                                {
607
 
608
                                        counter_write++;
609
                                        counter++;
610
 
611
                                        v_ecb.value.integer = 1;
612
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
613
 
614
                                }else if(counter == 1)
615
                                {
616
 
617
                                        v_ecb.value.integer = 0;
618
                                        vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
619
                                        counter=0;
620
 
621
                                }
622
 
623
                                if(counter_write == 1)
624
                                {
625
                                        STATE =IDLE;
626
                                        counter_write = 0;
627
                                        counter=0;
628
 
629
                                        PACKETS_GENERATED = PACKETS_GENERATED + 1;
630
                                }
631
 
632
 
633
 
634
                break;
635
 
636
                }
637
 
638
        }
639
 
640
        return 0;
641
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.