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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [aes_init.h] - Blame information for rev 18

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 init_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
        vpiHandle i = vpi_handle_by_name("AES_GLADIC_tb.i", NULL);
92
 
93
 
94
 
95
        STATE = IDLE;
96
 
97
 
98
        counter_write = 0;
99
        counter_read  = 0;
100 12 redbear
        counter_wait  = 0;
101 4 redbear
        PACKETS_GENERATED = 0;
102
        counter = 0;
103
        reset_counter = 0;
104
        flag = 0;
105
 
106
        a = 0;
107
        b = 0;
108
        c = 0;
109
        d = 0;
110
 
111 9 redbear
        v_monitor.value.integer=0;
112
        v_monitor_catch.value.integer=0;
113 12 redbear
        A=B=C=D=E=F=G=H=I=J=L=M=N=O=0;
114 9 redbear
 
115
        for(counter_monitor=0;counter_monitor < 16;counter_monitor++)
116
        {
117
                INPUT_KEYR[counter_monitor] =0x00;
118
                OUTPUT_KEYR[counter_monitor]=0x00;
119
 
120
                INPUT_IVR[counter_monitor]  =0x00;
121
                OUTPUT_IVR[counter_monitor] =0x00;
122
 
123
                INPUT_TEXT[counter_monitor]=0x00;
124
                OUTPUT_TEXT[counter_monitor]=0x00;
125
        }
126
 
127
        counter_monitor=0;
128
        cycle_counter =0;
129
 
130 12 redbear
 
131
        /*
132
                ECB ERROR TEST CASES DEFINITIONS
133 4 redbear
        */
134 12 redbear
 
135
        vector_CR[0]= 1;     // ECB ENCRYPTION  REGISTER ERROR DATATYPE 0
136
        vector_CR[1]= 3;     // ECB ENCRYPTION  REGISTER ERROR DATATYPE 1
137
        vector_CR[2]= 5;     // ECB ENCRYPTION  REGISTER ERROR DATATYPE 2
138
        vector_CR[3]= 7;     // ECB ENCRYPTION  REGISTER ERROR DATATYPE 3
139 4 redbear
 
140 12 redbear
        vector_CR[4]= 1025;  // ECB ENCRYPTION INT_ERR DATATYPE 0
141
        vector_CR[5]= 1027;  // ECB ENCRYPTION INT_ERR DATATYPE 1
142
        vector_CR[6]= 1029;  // ECB ENCRYPTION INT_ERR DATATYPE 2
143
        vector_CR[7]= 1031;  // ECB ENCRYPTION INT_ERR DATATYPE 3
144 4 redbear
 
145 12 redbear
        vector_CR[8] = 6145;  // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 0
146
        vector_CR[9] = 6147;  // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 1
147
        vector_CR[10]= 6149;  // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 2
148
        vector_CR[11]= 6151;  // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 3
149
 
150
        vector_CR[12]= 7169;  // ECB ENCRYPTION DMA INT_ERR DATATYPE 0
151
        vector_CR[13]= 7171;  // ECB ENCRYPTION DMA INT_ERR DATATYPE 1
152
        vector_CR[14]= 7173;  // ECB ENCRYPTION DMA INT_ERR DATATYPE 2
153
        vector_CR[15]= 7175;  // ECB ENCRYPTION DMA INT_ERR DATATYPE 3
154
 
155
        vector_CR[16]= 513;   // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 0
156
        vector_CR[17]= 515;   // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 1
157
        vector_CR[18]= 517;   // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 2
158
        vector_CR[19]= 519;   // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 3
159
 
160
        vector_CR[20]= 1537;  // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 0
161
        vector_CR[21]= 1539;  // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 1
162
        vector_CR[22]= 1541;  // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 2
163
        vector_CR[23]= 1543;  // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 3
164
 
165
        vector_CR[24]= 17;    // ECB DECRYPTION REGISTER ERROR DATATYPE 0
166
        vector_CR[25]= 19;    // ECB DECRYPTION REGISTER ERROR DATATYPE 1
167
        vector_CR[26]= 21;    // ECB DECRYPTION REGISTER ERROR DATATYPE 2
168
        vector_CR[27]= 23;    // ECB DECRYPTION REGISTER ERROR DATATYPE 3
169
 
170
        vector_CR[28]= 1041;  // ECB DECRYPTION INT_ERR DATATYPE 0
171
        vector_CR[29]= 1043;  // ECB DECRYPTION INT_ERR DATATYPE 1
172
        vector_CR[30]= 1045;  // ECB DECRYPTION INT_ERR DATATYPE 2
173
        vector_CR[31]= 1047;  // ECB DECRYPTION INT_ERR DATATYPE 3
174
 
175
        vector_CR[32]= 6161;  // ECB DECRYPTION DMA REGISTER ERROR  DATATYPE 0
176
        vector_CR[33]= 6163;  // ECB DECRYPTION DMA REGISTER ERROR  DATATYPE 1
177
        vector_CR[34]= 6165;  // ECB DECRYPTION DMA REGISTER ERROR  DATATYPE 2
178
        vector_CR[35]= 6167;  // ECB DECRYPTION DMA REGISTER ERROR  DATATYPE 3
179
 
180
        vector_CR[36]= 7185;  // ECB DECRYPTION DMA INT_ERR  DATATYPE 0
181
        vector_CR[37]= 7187;  // ECB DECRYPTION DMA INT_ERR  DATATYPE 1
182
        vector_CR[38]= 7189;  // ECB DECRYPTION DMA INT_ERR  DATATYPE 2
183
        vector_CR[39]= 7191;  // ECB DECRYPTION DMA INT_ERR  DATATYPE 3
184
 
185
        vector_CR[40]= 529;   // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 0
186
        vector_CR[41]= 531;   // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 1
187
        vector_CR[42]= 533;   // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 2
188
        vector_CR[43]= 535;   // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 3
189
 
190
        vector_CR[44]= 1553;  // ECB DECRYPTION INT CCF INT_ERR DATATYPE 0
191
        vector_CR[45]= 1555;  // ECB DECRYPTION INT CCF INT_ERR DATATYPE 1
192
        vector_CR[46]= 1557;  // ECB DECRYPTION INT CCF INT_ERR DATATYPE 2
193
        vector_CR[47]= 1559;  // ECB DECRYPTION INT CCF INT_ERR DATATYPE 3
194
 
195
        vector_CR[48]= 25;    // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 0
196
        vector_CR[49]= 27;    // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 1
197
        vector_CR[50]= 29;    // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 2
198
        vector_CR[51]= 31;    // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 3
199
 
200
        vector_CR[52]= 1049;  // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 0
201
        vector_CR[53]= 1051;  // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 1
202
        vector_CR[54]= 1053;  // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 2
203
        vector_CR[55]= 1055;  // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 3
204
 
205
        vector_CR[56]= 6169;  // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 0
206
        vector_CR[57]= 6171;  // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 1
207
        vector_CR[58]= 6173;  // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 2
208
        vector_CR[59]= 6175;  // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 3
209
 
210
        vector_CR[60]= 7193;  // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 0
211
        vector_CR[61]= 7195;  // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 1
212
        vector_CR[62]= 7197;  // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 2
213
        vector_CR[63]= 7199;  // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 3
214
 
215
        vector_CR[64]= 537;   // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 0
216
        vector_CR[65]= 539;   // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 1
217
        vector_CR[66]= 541;   // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 2
218
        vector_CR[67]= 543;   // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 3
219
 
220
        vector_CR[68]= 1561;  // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 0
221
        vector_CR[69]= 1563;  // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 1
222
        vector_CR[70]= 1565;  // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 2
223
        vector_CR[71]= 1567;  // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 3
224
 
225
        vector_CR[72]= 9;     // ECB KEY GENERATION REGISTER ERROR 
226
        vector_CR[73]= 1033;  // ECB KEY GENERATION INT_ERR 
227
 
228
        vector_CR[74]= 6153;  // ECB KEY GENERATION DMA REGISTER ERROR 
229
        vector_CR[75]= 7177;  // ECB KEY GENERATION DMA INT_ERR 
230
 
231
        vector_CR[76]= 521;   // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR
232
        vector_CR[77]= 1545;  // ECB DECRYPTION DERIVATION INT CCF INT_ERR
233
 
234
 
235
        /*
236
                CBC ERROR TEST CASES DEFINITIONS
237
        */
238
 
239
        vector_CR[78]= 33;    // CBC ENCRYPTION  REGISTER ERROR DATATYPE 0
240
        vector_CR[79]= 35;    // CBC ENCRYPTION  REGISTER ERROR DATATYPE 1
241
        vector_CR[80]= 37;    // CBC ENCRYPTION  REGISTER ERROR DATATYPE 2
242
        vector_CR[81]= 39;    // CBC ENCRYPTION  REGISTER ERROR DATATYPE 3
243
 
244
        vector_CR[82]= 1057;  // CBC ENCRYPTION INT_ERR DATATYPE 0
245
        vector_CR[83]= 1059;  // CBC ENCRYPTION INT_ERR DATATYPE 1
246
        vector_CR[84]= 1061;  // CBC ENCRYPTION INT_ERR DATATYPE 2
247
        vector_CR[85]= 1063;  // CBC ENCRYPTION INT_ERR DATATYPE 3
248
 
249
        vector_CR[86]= 6177;  // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 0
250
        vector_CR[87]= 6179;  // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 1
251
        vector_CR[88]= 6181;  // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 2
252
        vector_CR[89]= 6183;  // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 3
253
 
254
        vector_CR[90]= 7201;  // CBC ENCRYPTION DMA INT_ERR DATATYPE 0
255
        vector_CR[91]= 7203;  // CBC ENCRYPTION DMA INT_ERR DATATYPE 1
256
        vector_CR[92]= 7205;  // CBC ENCRYPTION DMA INT_ERR DATATYPE 2
257
        vector_CR[92]= 7207;  // CBC ENCRYPTION DMA INT_ERR DATATYPE 3
258
 
259
        vector_CR[93]= 545;   // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 0
260
        vector_CR[94]= 547;   // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 1
261
        vector_CR[95]= 549;   // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 2
262
        vector_CR[96]= 551;   // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 3
263
 
264
        vector_CR[97]= 1569;  // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 0
265
        vector_CR[98]= 1571;  // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 1
266
        vector_CR[99]= 1573;  // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 2
267
        vector_CR[100]= 1575; // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 3
268
 
269
        vector_CR[101]= 49;   // CBC DECRYPTION REGISTER ERROR DATATYPE 0
270
        vector_CR[102]= 51;   // CBC DECRYPTION REGISTER ERROR DATATYPE 1
271
        vector_CR[103]= 53;   // CBC DECRYPTION REGISTER ERROR DATATYPE 2
272
        vector_CR[104]= 55;   // CBC DECRYPTION REGISTER ERROR DATATYPE 3
273
 
274
        vector_CR[105]= 1073; // CBC DECRYPTION INT_ERR DATATYPE 0
275
        vector_CR[106]= 1075; // CBC DECRYPTION INT_ERR DATATYPE 1
276
        vector_CR[107]= 1077; // CBC DECRYPTION INT_ERR DATATYPE 2
277
        vector_CR[108]= 1079; // CBC DECRYPTION INT_ERR DATATYPE 3
278
 
279
        vector_CR[109]= 6193; // CBC DECRYPTION DMA REGISTER ERROR  DATATYPE 0
280
        vector_CR[110]= 6195; // CBC DECRYPTION DMA REGISTER ERROR  DATATYPE 1
281
        vector_CR[111]= 6197; // CBC DECRYPTION DMA REGISTER ERROR  DATATYPE 2
282
        vector_CR[112]= 6199; // CBC DECRYPTION DMA REGISTER ERROR  DATATYPE 3
283
 
284
        vector_CR[113]= 7217; // CBC DECRYPTION DMA INT_ERR  DATATYPE 0
285
        vector_CR[114]= 7219; // CBC DECRYPTION DMA INT_ERR  DATATYPE 1
286
        vector_CR[115]= 7221; // CBC DECRYPTION DMA INT_ERR  DATATYPE 2
287
        vector_CR[116]= 7223; // CBC DECRYPTION DMA INT_ERR  DATATYPE 3
288
 
289
        vector_CR[117]= 561;  // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 0
290
        vector_CR[118]= 563;  // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 1
291
        vector_CR[119]= 565;  // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 2
292
        vector_CR[120]= 567;  // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 3
293
 
294
        vector_CR[121]= 1585; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 0
295
        vector_CR[122]= 1587; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 1
296
        vector_CR[123]= 1589; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 2
297
        vector_CR[124]= 1591; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 3
298
 
299
        vector_CR[125]= 57;   // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 0
300
        vector_CR[126]= 59;   // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 1
301
        vector_CR[127]= 61;   // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 2
302
        vector_CR[128]= 63;   // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 3
303
 
304
        vector_CR[129]= 1081; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 0
305
        vector_CR[130]= 1083; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 1
306
        vector_CR[131]= 1085; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 2
307
        vector_CR[132]= 1087; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 3
308
 
309
        vector_CR[133]= 6201; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 0
310
        vector_CR[134]= 6203; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 1
311
        vector_CR[135]= 6205; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 2
312
        vector_CR[136]= 6207; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 3
313
 
314
        vector_CR[137]= 7225; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 0
315
        vector_CR[138]= 7227; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 1
316
        vector_CR[139]= 7229; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 2
317
        vector_CR[140]= 7231; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 3
318
 
319
        vector_CR[141]= 569;  // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 0
320
        vector_CR[142]= 571;  // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 1
321
        vector_CR[143]= 573;  // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 2
322
        vector_CR[144]= 575;  // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 3
323
 
324
        vector_CR[145]= 1593; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 0
325
        vector_CR[146]= 1595; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 1
326
        vector_CR[147]= 1597; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 2
327
        vector_CR[148]= 1599; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 3
328
 
329
        vector_CR[149]= 41;   // CBC KEY GENERATION REGISTER ERROR 
330
        vector_CR[150]= 1065; // CBC KEY GENERATION INT_ERR 
331
 
332
        vector_CR[151]= 6185; // CBC KEY GENERATION DMA REGISTER ERROR 
333
        vector_CR[152]= 7209; // CBC KEY GENERATION DMA INT_ERR 
334
 
335
        vector_CR[153]= 553;  // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR
336
        vector_CR[154]= 1577; // CBC DECRYPTION DERIVATION INT CCF INT_ERR
337
 
338
 
339
        /*
340
                CTR ERROR TEST CASES DEFINITIONS
341
        */
342
 
343
        vector_CR[155]= 65;   // CTR ENCRYPTION  REGISTER ERROR DATATYPE 0
344
        vector_CR[156]= 67;   // CTR ENCRYPTION  REGISTER ERROR DATATYPE 1
345
        vector_CR[157]= 69;   // CTR ENCRYPTION  REGISTER ERROR DATATYPE 2
346
        vector_CR[158]= 71;   // CTR ENCRYPTION  REGISTER ERROR DATATYPE 3
347
 
348
        vector_CR[159]= 1089; // CTR ENCRYPTION INT_ERR DATATYPE 0
349
        vector_CR[160]= 1091; // CTR ENCRYPTION INT_ERR DATATYPE 1
350
        vector_CR[161]= 1093; // CTR ENCRYPTION INT_ERR DATATYPE 2
351
        vector_CR[162]= 1095; // CTR ENCRYPTION INT_ERR DATATYPE 3
352
 
353
        vector_CR[163]= 6209; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 0
354
        vector_CR[164]= 6211; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 1
355
        vector_CR[165]= 6213; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 2
356
        vector_CR[166]= 6215; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 3
357
 
358
        vector_CR[167]= 7233; // CTR ENCRYPTION DMA INT_ERR DATATYPE 0
359
        vector_CR[168]= 7235; // CTR ENCRYPTION DMA INT_ERR DATATYPE 1
360
        vector_CR[169]= 7237; // CTR ENCRYPTION DMA INT_ERR DATATYPE 2
361
        vector_CR[170]= 7239; // CTR ENCRYPTION DMA INT_ERR DATATYPE 3
362
 
363
        vector_CR[171]= 577;  // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 0
364
        vector_CR[172]= 579;  // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 1
365
        vector_CR[173]= 581;  // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 2
366
        vector_CR[174]= 583;  // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 3
367
 
368
        vector_CR[175]= 1601; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 0
369
        vector_CR[176]= 1603; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 1
370
        vector_CR[177]= 1605; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 2
371
        vector_CR[178]= 1607; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 3
372
 
373
        vector_CR[179]= 81;   // CTR DECRYPTION REGISTER ERROR DATATYPE 0
374
        vector_CR[180]= 83;   // CTR DECRYPTION REGISTER ERROR DATATYPE 1
375
        vector_CR[181]= 85;   // CTR DECRYPTION REGISTER ERROR DATATYPE 2
376
        vector_CR[182]= 87;   // CTR DECRYPTION REGISTER ERROR DATATYPE 3
377
 
378
        vector_CR[183]= 1105; // CTR DECRYPTION INT_ERR DATATYPE 0
379
        vector_CR[184]= 1107; // CTR DECRYPTION INT_ERR DATATYPE 1
380
        vector_CR[185]= 1109; // CTR DECRYPTION INT_ERR DATATYPE 2
381
        vector_CR[186]= 1111; // CTR DECRYPTION INT_ERR DATATYPE 3
382
 
383
        vector_CR[187]= 6225; // CTR DECRYPTION DMA REGISTER ERROR  DATATYPE 0
384
        vector_CR[188]= 6227; // CTR DECRYPTION DMA REGISTER ERROR  DATATYPE 1
385
        vector_CR[189]= 6229; // CTR DECRYPTION DMA REGISTER ERROR  DATATYPE 2
386
        vector_CR[190]= 6231; // CTR DECRYPTION DMA REGISTER ERROR  DATATYPE 3
387
 
388
        vector_CR[191]= 7249; // CTR DECRYPTION DMA INT_ERR  DATATYPE 0
389
        vector_CR[192]= 7251; // CTR DECRYPTION DMA INT_ERR  DATATYPE 1
390
        vector_CR[193]= 7253; // CTR DECRYPTION DMA INT_ERR  DATATYPE 2
391
        vector_CR[194]= 7255; // CTR DECRYPTION DMA INT_ERR  DATATYPE 3
392
 
393
        vector_CR[195]= 593;  // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 0
394
        vector_CR[196]= 595;  // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 1
395
        vector_CR[197]= 597;  // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 2
396
        vector_CR[198]= 599;  // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 3
397
 
398
        vector_CR[199]= 1617; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 0
399
        vector_CR[200]= 1619; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 1
400
        vector_CR[201]= 1621; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 2
401
        vector_CR[202]= 1623; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 3
402
 
403
        vector_CR[203]= 89;   // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 0
404
        vector_CR[204]= 91;   // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 1
405
        vector_CR[205]= 93;   // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 2
406
        vector_CR[206]= 95;   // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 3
407
 
408
        vector_CR[207]= 1113; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 0
409
        vector_CR[208]= 1115; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 1
410
        vector_CR[209]= 1117; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 2
411
        vector_CR[210]= 1119; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 3
412
 
413
        vector_CR[211]= 6233; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 0
414
        vector_CR[212]= 6235; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 1
415
        vector_CR[213]= 6237; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 2
416
        vector_CR[214]= 6239; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 3
417
 
418
        vector_CR[215]= 7257; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 0
419
        vector_CR[216]= 7259; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 1
420
        vector_CR[217]= 7261; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 2
421
        vector_CR[218]= 7263; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 3
422
 
423
        vector_CR[219]= 601;  // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 0
424
        vector_CR[220]= 603;  // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 1
425
        vector_CR[221]= 605;  // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 2
426
        vector_CR[222]= 607;  // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 3
427
 
428
        vector_CR[223]= 1625; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 0
429
        vector_CR[224]= 1627; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 1
430
        vector_CR[225]= 1629; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 2
431
        vector_CR[226]= 1631; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 3
432
 
433
        vector_CR[227]= 73;   // CTR KEY GENERATION REGISTER ERROR 
434
        vector_CR[228]= 1097; // CTR KEY GENERATION INT_ERR 
435
 
436
        vector_CR[229]= 6185; // CTR KEY GENERATION DMA REGISTER ERROR 
437
        vector_CR[230]= 7209; // CTR KEY GENERATION DMA INT_ERR 
438
 
439
        vector_CR[231]= 553;  // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR
440
        vector_CR[232]= 1577; // CTR DECRYPTION DERIVATION INT CCF INT_ERR
441
 
442
        /*
443
                ADDR CASES DEFINITIONS
444
        */
445
 
446 4 redbear
        vector_address[0]= ADDR_AES_CR;
447 9 redbear
        vector_address[1]= ADDR_AES_KEYR3;
448
        vector_address[2]= ADDR_AES_KEYR2;
449
        vector_address[3]= ADDR_AES_KEYR1;
450
        vector_address[4]= ADDR_AES_KEYR0;
451 4 redbear
        vector_address[5]= ADDR_AES_IVR3;
452
        vector_address[6]= ADDR_AES_IVR2;
453
        vector_address[7]= ADDR_AES_IVR1;
454
        vector_address[8]= ADDR_AES_IVR0;
455 12 redbear
        vector_address[9]= ADDR_AES_SR;
456 4 redbear
 
457 18 redbear
        /*
458
                THIS IS TO BE USED LIKE A BACKUP VALUE FROM LAST CR GENERATED ON SUFLE
459
        */
460
        last_cr = 0 ;
461
        counter_sufle = 0 ;
462 4 redbear
 
463
        v_initial.format=vpiIntVal;
464
 
465
        v_initial.value.integer = 0;
466
        vpi_put_value(PENABLE, &v_initial, NULL, vpiNoDelay);
467
        vpi_put_value(PSEL , &v_initial, NULL, vpiNoDelay);
468
        vpi_put_value(PADDR, &v_initial, NULL, vpiNoDelay);
469
        vpi_put_value(i, &v_initial, NULL, vpiNoDelay);
470
        vpi_put_value(PWRITE, &v_initial, NULL, vpiNoDelay);
471
        vpi_put_value(PWDATA, &v_initial, NULL, vpiNoDelay);
472
 
473
 
474
 
475
        return 0;
476
}

powered by: WebSVN 2.1.0

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