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

Subversion Repositories nfhc

[/] [nfhc/] [trunk/] [sha1/] [sha1.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("sha1");
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 , "31 downto 0", "" );
25
DECLAR ("init", ":2", "B", IN , ""          , "" );
26
DECLAR (  "h", ":2", "X", OUT, "31 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 ("sc_pr", ":1", "X", OUT, " 1 downto 0", "" );
31
//DECLAR ("a_prb", ":2", "X", OUT, "31 downto 0", "" );
32
//DECLAR ("b_prb", ":2", "X", OUT, "31 downto 0", "" );
33
//DECLAR ("c_prb", ":2", "X", OUT, "31 downto 0", "" );
34
//DECLAR ("d_prb", ":2", "X", OUT, "31 downto 0", "" );
35
//DECLAR ("e_prb", ":2", "X", OUT, "31 downto 0", "" );
36
//DECLAR ("w_prb", ":2", "X", OUT, "31 downto 0", "" );
37
DECLAR ("vss", ":1", "B", IN , ""           , "" );
38
DECLAR ("vdd", ":1", "B", IN , ""           , "" );
39
 
40
AFFECT ("0", "vss", "0b0");
41
AFFECT ("0", "vdd", "0b1");
42
 
43
AFFECT (  "0", "rst", "0b1");
44
AFFECT (  "0", "clk", "0b0");
45
AFFECT (  "0",  "ld", "0b0");
46
AFFECT (  "0",   "m", "0x00000000");
47
AFFECT (  "0","init", "0b0");
48
AFFECT ("+50", "clk", "0b1");
49
AFFECT ("+50", "clk", "0b0");
50
AFFECT ( "+0", "rst", "0b0");
51
AFFECT ( "+0",  "ld", "0b1");
52
AFFECT ( "+0","init", "0b1");
53
 
54
  AFFECT ( "+0",   "m", "0x61626380");
55
  AFFECT ("+50", "clk", "0b1" );
56
  AFFECT ("+50", "clk", "0b0" );
57
  AFFECT ( "+0",   "m", "0x00000000");
58
  i=1;
59
for (;i<0xf; i++)
60
{
61
  AFFECT ("+50", "clk", "0b1" );
62
  AFFECT ("+50", "clk", "0b0" );
63
}
64
  AFFECT ( "+0",   "m", "0x00000018");
65
  AFFECT ("+50", "clk", "0b1" );
66
  AFFECT ("+50", "clk", "0b0" );
67
  i++;
68
  AFFECT ( "+0",   "m", "0x00000000");
69
  AFFECT ( "+0",  "ld", "0b0");
70
  AFFECT ( "+0","init", "0b0");
71
 
72
for (; i<0x5f+1; i++)
73
{
74
  AFFECT ("+50", "clk", "0b1" );
75
  AFFECT ("+50", "clk", "0b0" );
76
}
77
 
78
AFFECT ("+50", "clk", "0b1");
79
AFFECT ("+50", "clk", "0b0");
80
AFFECT ( "+0", "rst", "0b0");
81
AFFECT ( "+0",  "ld", "0b1");
82
AFFECT ( "+0","init", "0b1");
83
 
84
AFFECT ( "+0",   "m", "0x61626364");
85
AFFECT ("+50", "clk", "0b1" );
86
AFFECT ("+50", "clk", "0b0" );
87
 
88
AFFECT ( "+0",   "m", "0x62636465");
89
AFFECT ("+50", "clk", "0b1" );
90
AFFECT ("+50", "clk", "0b0" );
91
 
92
AFFECT ( "+0",   "m", "0x63646566");
93
AFFECT ("+50", "clk", "0b1" );
94
AFFECT ("+50", "clk", "0b0" );
95
 
96
AFFECT ( "+0",   "m", "0x64656667");
97
AFFECT ("+50", "clk", "0b1" );
98
AFFECT ("+50", "clk", "0b0" );
99
 
100
AFFECT ( "+0",   "m", "0x65666768");
101
AFFECT ("+50", "clk", "0b1" );
102
AFFECT ("+50", "clk", "0b0" );
103
 
104
AFFECT ( "+0",   "m", "0x66676869");
105
AFFECT ("+50", "clk", "0b1" );
106
AFFECT ("+50", "clk", "0b0" );
107
 
108
AFFECT ( "+0",   "m", "0x6768696a");
109
AFFECT ("+50", "clk", "0b1" );
110
AFFECT ("+50", "clk", "0b0" );
111
 
112
AFFECT ( "+0",   "m", "0x68696a6b");
113
AFFECT ("+50", "clk", "0b1" );
114
AFFECT ("+50", "clk", "0b0" );
115
 
116
AFFECT ( "+0",   "m", "0x696a6b6c");
117
AFFECT ("+50", "clk", "0b1" );
118
AFFECT ("+50", "clk", "0b0" );
119
 
120
AFFECT ( "+0",   "m", "0x6a6b6c6d");
121
AFFECT ("+50", "clk", "0b1" );
122
AFFECT ("+50", "clk", "0b0" );
123
 
124
AFFECT ( "+0",   "m", "0x6b6c6d6e");
125
AFFECT ("+50", "clk", "0b1" );
126
AFFECT ("+50", "clk", "0b0" );
127
 
128
AFFECT ( "+0",   "m", "0x6c6d6e6f");
129
AFFECT ("+50", "clk", "0b1" );
130
AFFECT ("+50", "clk", "0b0" );
131
 
132
AFFECT ( "+0",   "m", "0x6d6e6f70");
133
AFFECT ("+50", "clk", "0b1" );
134
AFFECT ("+50", "clk", "0b0" );
135
 
136
AFFECT ( "+0",   "m", "0x6e6f7071");
137
AFFECT ("+50", "clk", "0b1" );
138
AFFECT ("+50", "clk", "0b0" );
139
 
140
AFFECT ( "+0",   "m", "0x80000000");
141
AFFECT ("+50", "clk", "0b1" );
142
AFFECT ("+50", "clk", "0b0" );
143
 
144
AFFECT ( "+0",   "m", "0x00000000");
145
AFFECT ("+50", "clk", "0b1" );
146
AFFECT ("+50", "clk", "0b0" );
147
 
148
AFFECT ( "+0",   "m", "0x00000000");
149
AFFECT ( "+0",  "ld", "0b0");
150
AFFECT ( "+0","init", "0b0");
151
 
152
for (; i<0xaf+1; i++)
153
{
154
  AFFECT ("+50", "clk", "0b1" );
155
  AFFECT ("+50", "clk", "0b0" );
156
}
157
 
158
for (; i<0xbf;i++)
159
{
160
AFFECT ( "+0",  "ld", "0b1");
161
AFFECT ("+50", "clk", "0b1");
162
AFFECT ("+50", "clk", "0b0");
163
}
164
 
165
AFFECT ( "+0",   "m", "0x000001c0");
166
AFFECT ("+50", "clk", "0b1");
167
AFFECT ("+50", "clk", "0b0");
168
AFFECT ( "+0",   "m", "0x00000000");
169
AFFECT ( "+0",  "ld", "0b0");
170
 
171
for (; i<0x11f+1; i++)
172
{
173
  AFFECT ("+50", "clk", "0b1" );
174
  AFFECT ("+50", "clk", "0b0" );
175
}
176
 
177
SAV_GENPAT ();
178
}
179
 

powered by: WebSVN 2.1.0

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