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

Subversion Repositories nfcc

[/] [nfcc/] [trunk/] [rijndael/] [keyexpansion/] [keyexpansion.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 arif_endro
#include <stdio.h>
2
#include "genpat.h"
3
 
4
char *inttostr(entier)
5
int entier;
6
 {
7
 char *str;
8
 str = (char *) mbkalloc (32 * sizeof (char));
9
 sprintf (str, "%d",entier);
10
 return(str);
11
 }
12
  /*------------------------------*/
13
  /* end of the description       */
14
  /*------------------------------*/
15
 
16
main ()
17
{
18
int i;
19
 
20
DEF_GENPAT("keyexpansion-tst");
21
SETTUNIT("ns");
22
 
23
/* interface */
24
DECLAR ("clk", ":1", "B", IN , ""           , "" );
25
DECLAR ("rst", ":1", "B", IN , ""           , "" );
26
DECLAR ("ld" , ":1", "B", IN , ""           , "" );
27
DECLAR ("key", ":1", "X", IN ,"31  downto 0", "" );
28
DECLAR ("Nk" , ":1", "X", IN ,  "3 downto 0", "" );
29
DECLAR ("w"  , ":1", "X", OUT,"31  downto 0", "" );
30
DECLAR ("v"  , ":1", "B", OUT, ""           , "" );
31
DECLAR ("vss", ":1", "B", IN , ""           , "" );
32
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
33
 
34
AFFECT ("0", "vss", "0b0");
35
AFFECT ("0", "vdd", "0b1");
36
 
37
AFFECT (   "0", "clk", "0b0");
38
AFFECT (   "0", "rst", "0b1");
39
AFFECT (   "0", "ld" , "0b0");
40
AFFECT (   "0", "key", "0x00000000");
41
AFFECT (   "0", "Nk" , "0x0");
42
AFFECT ("+100", "clk", "0b1");
43
 
44
AFFECT ("+100", "clk", "0b0");
45
AFFECT ("  +0", "rst", "0b0");
46
AFFECT ("  +0", "ld" , "0b1");
47
AFFECT ("  +0", "key", "0x2b7e1516");
48
AFFECT ("  +0", "Nk" , "0x4");
49
AFFECT ("+100", "clk", "0b1");
50
 
51
AFFECT ("+100", "clk", "0b0");
52
AFFECT ("  +0", "key", "0x28aed2a6");
53
AFFECT ("+100", "clk", "0b1");
54
 
55
AFFECT ("+100", "clk", "0b0");
56
AFFECT ("  +0", "key", "0xabf71588");
57
AFFECT ("+100", "clk", "0b1");
58
 
59
AFFECT ("+100", "clk", "0b0");
60
AFFECT ("  +0", "key", "0x09cf4f3c");
61
AFFECT ("+100", "clk", "0b1");
62
 
63
AFFECT ("+100", "clk", "0b0");
64
AFFECT ("  +0", "ld" , "0b0");
65
AFFECT ("  +0", "key", "0x00000000");
66
AFFECT ("+100", "clk", "0b1");
67
 
68
for (i=0; i<56; i++)
69
{
70
  AFFECT ("+100", "clk", "0b0" );
71
  AFFECT ("+100", "clk", "0b1" );
72
}
73
 
74
AFFECT ("+100", "clk", "0b0" );
75
AFFECT (  "+0", "rst", "0b1");
76
AFFECT (  "+0", "ld" , "0b0");
77
AFFECT (  "+0", "key", "0x00000000");
78
AFFECT (  "+0", "Nk" , "0x0");
79
AFFECT ("+100", "clk", "0b1");
80
 
81
AFFECT ("+100", "clk", "0b0");
82
AFFECT ("  +0", "rst", "0b0");
83
AFFECT ("  +0", "ld" , "0b1");
84
AFFECT ("  +0", "key", "0x8e73b0f7");
85
AFFECT ("  +0", "Nk" , "0x6");
86
AFFECT ("+100", "clk", "0b1");
87
 
88
AFFECT ("+100", "clk", "0b0");
89
AFFECT ("  +0", "key", "0xda0e6452");
90
AFFECT ("+100", "clk", "0b1");
91
 
92
AFFECT ("+100", "clk", "0b0");
93
AFFECT ("  +0", "key", "0xc810f32b");
94
AFFECT ("+100", "clk", "0b1");
95
 
96
AFFECT ("+100", "clk", "0b0");
97
AFFECT ("  +0", "key", "0x809079e5");
98
AFFECT ("+100", "clk", "0b1");
99
 
100
AFFECT ("+100", "clk", "0b0");
101
AFFECT ("  +0", "key", "0x62f8ead2");
102
AFFECT ("+100", "clk", "0b1");
103
 
104
AFFECT ("+100", "clk", "0b0");
105
AFFECT ("  +0", "key", "0x522c6b7b");
106
AFFECT ("+100", "clk", "0b1");
107
 
108
AFFECT ("+100", "clk", "0b0");
109
AFFECT ("  +0", "ld" , "0b0");
110
AFFECT ("  +0", "key", "0x00000000");
111
AFFECT ("+100", "clk", "0b1");
112
 
113
for (i=0; i<56; i++)
114
{
115
  AFFECT ("+100", "clk", "0b0" );
116
  AFFECT ("+100", "clk", "0b1" );
117
}
118
 
119
AFFECT ("+100", "clk", "0b0" );
120
AFFECT (  "+0", "rst", "0b1");
121
AFFECT (  "+0", "ld" , "0b0");
122
AFFECT (  "+0", "key", "0x00000000");
123
AFFECT (  "+0", "Nk" , "0x0");
124
AFFECT ("+100", "clk", "0b1");
125
 
126
AFFECT ("+100", "clk", "0b0");
127
AFFECT ("  +0", "rst", "0b0");
128
AFFECT ("  +0", "ld" , "0b1");
129
AFFECT ("  +0", "key", "0x603deb10");
130
AFFECT ("  +0", "Nk" , "0x8");
131
AFFECT ("+100", "clk", "0b1");
132
 
133
AFFECT ("+100", "clk", "0b0");
134
AFFECT ("  +0", "key", "0x15ca71be");
135
AFFECT ("+100", "clk", "0b1");
136
 
137
AFFECT ("+100", "clk", "0b0");
138
AFFECT ("  +0", "key", "0x2b73aef0");
139
AFFECT ("+100", "clk", "0b1");
140
 
141
AFFECT ("+100", "clk", "0b0");
142
AFFECT ("  +0", "key", "0x857d7781");
143
AFFECT ("+100", "clk", "0b1");
144
 
145
AFFECT ("+100", "clk", "0b0");
146
AFFECT ("  +0", "key", "0x1f352c07");
147
AFFECT ("+100", "clk", "0b1");
148
 
149
AFFECT ("+100", "clk", "0b0");
150
AFFECT ("  +0", "key", "0x3b6108d7");
151
AFFECT ("+100", "clk", "0b1");
152
 
153
AFFECT ("+100", "clk", "0b0");
154
AFFECT ("  +0", "key", "0x2d9810a3");
155
AFFECT ("+100", "clk", "0b1");
156
 
157
AFFECT ("+100", "clk", "0b0");
158
AFFECT ("  +0", "key", "0x0914dff4");
159
AFFECT ("+100", "clk", "0b1");
160
 
161
AFFECT ("+100", "clk", "0b0");
162
AFFECT ("  +0", "ld" , "0b0");
163
AFFECT ("  +0", "key", "0x00000000");
164
AFFECT ("+100", "clk", "0b1");
165
 
166
for (i=0; i<56; i++)
167
{
168
  AFFECT ("+100", "clk", "0b0" );
169
  AFFECT ("+100", "clk", "0b1" );
170
}
171
 
172
AFFECT ("+100", "clk", "0b0");
173
SAV_GENPAT ();
174
 
175
}
176
 

powered by: WebSVN 2.1.0

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