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

Subversion Repositories nfhc

[/] [nfhc/] [trunk/] [sha512/] [sha512.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
main ()
14
{
15
int i;
16
 
17
DEF_GENPAT("sha512");
18
SETTUNIT("ns");
19
 
20
/* interface */
21
DECLAR ("clk", ":1", "B", IN , ""           , "" );
22
DECLAR ("rst", ":1", "B", IN , ""           , "" );
23
DECLAR ( "ld", ":1", "B", IN , ""           , "" );
24
DECLAR (  "m", ":2", "X", IN , "63 downto 0", "" );
25
DECLAR ("init", ":2", "B", IN , ""          , "" );
26
DECLAR ( "md", ":2", "X", OUT, "63 downto 0", "" );
27
DECLAR (  "v", ":1", "B", OUT, ""           , "" );
28
//DECLAR ("ctr2p", ":1", "X", OUT, " 3 downto 0", "" );
29
//DECLAR ("ctr3p", ":1", "X", OUT, " 5 downto 0", "" );
30
//DECLAR ("w_prb", ":2", "X", OUT, "31 downto 0", "" );
31
//DECLAR ("k_prb", ":2", "X", OUT, "31 downto 0", "" );
32
//DECLAR ("a_prb", ":2", "X", OUT, "31 downto 0", "" );
33
//DECLAR ("b_prb", ":2", "X", OUT, "31 downto 0", "" );
34
//DECLAR ("c_prb", ":2", "X", OUT, "31 downto 0", "" );
35
//DECLAR ("d_prb", ":2", "X", OUT, "31 downto 0", "" );
36
//DECLAR ("e_prb", ":2", "X", OUT, "31 downto 0", "" );
37
//DECLAR ("f_prb", ":2", "X", OUT, "31 downto 0", "" );
38
//DECLAR ("g_prb", ":2", "X", OUT, "31 downto 0", "" );
39
//DECLAR ("h_prb", ":2", "X", OUT, "31 downto 0", "" );
40
DECLAR ("vss", ":1", "B", IN , ""           , "" );
41
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
42
 
43
AFFECT ("0", "vss", "0b0");
44
AFFECT ("0", "vdd", "0b1");
45
 
46
AFFECT (  "0", "rst", "0b1");
47
AFFECT (  "0", "clk", "0b0");
48
AFFECT (  "0",  "ld", "0b0");
49
AFFECT (  "0",   "m", "0x0000000000000000");
50
AFFECT (  "0","init", "0b0");
51
AFFECT ("+100", "clk", "0b1");
52
AFFECT ("+100", "clk", "0b0");
53
AFFECT ( "+0", "rst", "0b0");
54
AFFECT ( "+0",  "ld", "0b1");
55
AFFECT ( "+0","init", "0b1");
56
 
57
  AFFECT ( "+0",   "m", "0x6162638000000000");
58
  AFFECT ("+100", "clk", "0b1" );
59
  AFFECT ("+100", "clk", "0b0" );
60
  AFFECT ( "+0",   "m", "0x0000000000000000");
61
  i=1;
62
for (;i<0xf; i++)
63
{
64
  AFFECT ("+100", "clk", "0b1" );
65
  AFFECT ("+100", "clk", "0b0" );
66
}
67
  AFFECT ( "+0",   "m", "0x0000000000000018");
68
  AFFECT ("+100", "clk", "0b1" );
69
  AFFECT ("+100", "clk", "0b0" );
70
  i++;
71
  AFFECT ( "+0",   "m", "0x0000000000000000");
72
  AFFECT ( "+0",  "ld", "0b0");
73
  AFFECT ( "+0","init", "0b0");
74
 
75
for (; i<0x5f+1; i++)
76
{
77
  AFFECT ("+100", "clk", "0b1" );
78
  AFFECT ("+100", "clk", "0b0" );
79
}
80
 
81
AFFECT ("+100", "clk", "0b1");
82
AFFECT ("+100", "clk", "0b0");
83
AFFECT ( "+0", "rst", "0b0");
84
AFFECT ( "+0",  "ld", "0b1");
85
AFFECT ( "+0","init", "0b1");
86
 
87
AFFECT ( "+0",   "m", "0x6162636465666768");
88
AFFECT ("+100", "clk", "0b1" );
89
AFFECT ("+100", "clk", "0b0" );
90
 
91
AFFECT ( "+0",   "m", "0x6263646566676869");
92
AFFECT ("+100", "clk", "0b1" );
93
AFFECT ("+100", "clk", "0b0" );
94
 
95
AFFECT ( "+0",   "m", "0x636465666768696a");
96
AFFECT ("+100", "clk", "0b1" );
97
AFFECT ("+100", "clk", "0b0" );
98
 
99
AFFECT ( "+0",   "m", "0x6465666768696a6b");
100
AFFECT ("+100", "clk", "0b1" );
101
AFFECT ("+100", "clk", "0b0" );
102
 
103
AFFECT ( "+0",   "m", "0x65666768696a6b6c");
104
AFFECT ("+100", "clk", "0b1" );
105
AFFECT ("+100", "clk", "0b0" );
106
 
107
AFFECT ( "+0",   "m", "0x666768696a6b6c6d");
108
AFFECT ("+100", "clk", "0b1" );
109
AFFECT ("+100", "clk", "0b0" );
110
 
111
AFFECT ( "+0",   "m", "0x6768696a6b6c6d6e");
112
AFFECT ("+100", "clk", "0b1" );
113
AFFECT ("+100", "clk", "0b0" );
114
 
115
AFFECT ( "+0",   "m", "0x68696a6b6c6d6e6f");
116
AFFECT ("+100", "clk", "0b1" );
117
AFFECT ("+100", "clk", "0b0" );
118
 
119
AFFECT ( "+0",   "m", "0x696a6b6c6d6e6f70");
120
AFFECT ("+100", "clk", "0b1" );
121
AFFECT ("+100", "clk", "0b0" );
122
 
123
AFFECT ( "+0",   "m", "0x6a6b6c6d6e6f7071");
124
AFFECT ("+100", "clk", "0b1" );
125
AFFECT ("+100", "clk", "0b0" );
126
 
127
AFFECT ( "+0",   "m", "0x6b6c6d6e6f707172");
128
AFFECT ("+100", "clk", "0b1" );
129
AFFECT ("+100", "clk", "0b0" );
130
 
131
AFFECT ( "+0",   "m", "0x6c6d6e6f70717273");
132
AFFECT ("+100", "clk", "0b1" );
133
AFFECT ("+100", "clk", "0b0" );
134
 
135
AFFECT ( "+0",   "m", "0x6d6e6f7071727374");
136
AFFECT ("+100", "clk", "0b1" );
137
AFFECT ("+100", "clk", "0b0" );
138
 
139
AFFECT ( "+0",   "m", "0x6e6f707172737475");
140
AFFECT ("+100", "clk", "0b1" );
141
AFFECT ("+100", "clk", "0b0" );
142
 
143
AFFECT ( "+0",   "m", "0x8000000000000000");
144
AFFECT ("+100", "clk", "0b1" );
145
AFFECT ("+100", "clk", "0b0" );
146
 
147
AFFECT ( "+0",   "m", "0x0000000000000000");
148
AFFECT ("+100", "clk", "0b1" );
149
AFFECT ("+100", "clk", "0b0" );
150
 
151
AFFECT ( "+0",   "m", "0x0000000000000000");
152
AFFECT ( "+0",  "ld", "0b0");
153
AFFECT ( "+0","init", "0b0");
154
 
155
for (; i<0xaf+1; i++)
156
{
157
  AFFECT ("+100", "clk", "0b1" );
158
  AFFECT ("+100", "clk", "0b0" );
159
}
160
 
161
for (; i<0xbf;i++)
162
{
163
AFFECT ( "+0",  "ld", "0b1");
164
AFFECT ("+100", "clk", "0b1");
165
AFFECT ("+100", "clk", "0b0");
166
}
167
 
168
AFFECT ( "+0",   "m", "0x0000000000000380");
169
AFFECT ("+100", "clk", "0b1");
170
AFFECT ("+100", "clk", "0b0");
171
AFFECT ( "+0",   "m", "0x0000000000000000");
172
AFFECT ( "+0",  "ld", "0b0");
173
 
174
for (; i<0x11f+1; i++)
175
{
176
  AFFECT ("+100", "clk", "0b1" );
177
  AFFECT ("+100", "clk", "0b0" );
178
}
179
 
180
SAV_GENPAT ();
181
}
182
 

powered by: WebSVN 2.1.0

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