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

Subversion Repositories idea

[/] [idea/] [trunk/] [fsm/] [heart_ctrl.fsm] - Blame information for rev 11

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 marta
-- File Name   : heart_ctrl.fsm                                 --
2
-- Description : The heart control of idea processor            --
3
-- Purpose     : To be used by SYF                              --
4
-- Date        : Aug 23, 2001                                   --
5
-- Version     : 1.1                                            --
6
-- Author      : Martadinata A.                                 --
7
-- Address     : VLSI RG, Dept. of Electrical Engineering ITB,  --
8
--               Bandung, Indonesia                             --
9
-- E-mail      : marta@ic.vlsi.itb.ac.id                        --
10
 
11
entity heart_ctrl is
12
port(
13
ck,reset,start,key_ready           : in  bit;
14
round                              : out  bit_vector(2 downto 0);
15
en1,en2,en3,en4,en5,en6,en7,en_out : out bit;
16
en_key_out,sel_in                  : out bit;
17
finish                             : out bit;
18
vdd, vss                           : in bit
19
);
20
end heart_ctrl;
21
 
22
architecture fsm of heart_ctrl is
23
 
24
type STATE_TYPE is (S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,
25
S15,S16,S17,S18,S19,S20,S21,S22,S23,S24,S25,S26,S27,S28,S29,S30,S31,
26
S32,S33,S34,S35,S36,S37,S38,S39,S40,S41,S42,S43,S44,S45,S46,
27
S47,S48,S49,S50,S51,S52,S53,S54,S55,S56,S57,S58,S59,S60,S61,S62,S63,S64,
28
S65,S66,S67);
29
 
30
-- pragma CLOCK ck
31
-- pragma CURRENT_STATE CURRENT_STATE
32
-- pragma NEXT_STATE NEXT_STATE
33
 
34
signal CURRENT_STATE,NEXT_STATE: STATE_TYPE;
35
begin
36
process (CURRENT_STATE,start,key_ready,reset)
37
   begin
38
      if (reset = '1') then
39
                NEXT_STATE <= S1;
40
      else
41
         case CURRENT_STATE is
42
-- round 1 --
43
              when S1 =>
44
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
45
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
46
                 round <= "000";
47
                 sel_in <= '0';
48
                 finish <= '0';
49
                 if((start and key_ready) = '1') then
50
                     en_key_out <= '1';
51
                     NEXT_STATE <= S2;
52
                 else
53
                     en_key_out <= '0';
54
                     NEXT_STATE <= S1;
55
                 end if;
56
              when S2 =>
57
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
58
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
59
                 finish <= '0';
60
                 round <= "000";
61
                 en_key_out <= '0';
62
                 sel_in <= '0';
63
                 NEXT_STATE <= S3;
64
              when S3 =>
65
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
66
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
67
                 finish <= '0';
68
                 round <= "000";
69
                 en_key_out <= '0';
70
                 sel_in <= '0';
71
                 NEXT_STATE <= S4;
72
              when S4 =>
73
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
74
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
75
                 finish <= '0';
76
                 round <= "000";
77
                 en_key_out <= '0';
78
                 sel_in <= '0';
79
                 NEXT_STATE <= S5;
80
              when S5 =>
81
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
82
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
83
                 finish <= '0';
84
                 round <= "000";
85
                 en_key_out <= '0';
86
                 sel_in <= '0';
87
                 NEXT_STATE <= S6;
88
              when S6 =>
89
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
90
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
91
                 finish <= '0';
92
                 round <= "000";
93
                 en_key_out <= '0';
94
                 sel_in <= '0';
95
                 NEXT_STATE <= S7;
96
              when S7 =>
97
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
98
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
99
                 finish <= '0';
100
                 round <= "000";
101
                 en_key_out <= '0';
102
                 sel_in <= '0';
103
                 NEXT_STATE <= S8;
104
              when S8 =>
105
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
106
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
107
                 finish <= '0';
108
                 round <= "000";
109
                 en_key_out <= '0';
110
                 sel_in <= '0';
111
                 NEXT_STATE <= S9;
112
 
113
-- round 2 --
114
              when S9 =>
115
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
116
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
117
                 finish <= '0';
118
                 round <= "001";
119
                 en_key_out <= '1';
120
                 sel_in <= '1';
121
                 NEXT_STATE <= S10;
122
              when S10 =>
123
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
124
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
125
                 finish <= '0';
126
                 round <= "001";
127
                 en_key_out <= '0';
128
                 sel_in <= '1';
129
                 NEXT_STATE <= S11;
130
              when S11 =>
131
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
132
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
133
                 finish <= '0';
134
                 round <= "001";
135
                 en_key_out <= '0';
136
                 sel_in <= '1';
137
                 NEXT_STATE <= S12;
138
              when S12 =>
139
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
140
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
141
                 finish <= '0';
142
                 round <= "001";
143
                 en_key_out <= '0';
144
                 sel_in <= '1';
145
                 NEXT_STATE <= S13;
146
              when S13 =>
147
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
148
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
149
                 finish <= '0';
150
                 round <= "001";
151
                 en_key_out <= '0';
152
                 sel_in <= '1';
153
                 NEXT_STATE <= S14;
154
              when S14 =>
155
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
156
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
157
                 finish <= '0';
158
                 round <= "001";
159
                 en_key_out <= '0';
160
                 sel_in <= '1';
161
                 NEXT_STATE <= S15;
162
              when S15 =>
163
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
164
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
165
                 finish <= '0';
166
                 round <= "001";
167
                 en_key_out <= '0';
168
                 sel_in <= '1';
169
                 NEXT_STATE <= S16;
170
              when S16 =>
171
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
172
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
173
                 finish <= '0';
174
                 round <= "001";
175
                 en_key_out <= '0';
176
                 sel_in <= '1';
177
                 NEXT_STATE <= S17;
178
-- round 3 --
179
              when S17 =>
180
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
181
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
182
                 finish <= '0';
183
                 round <= "010";
184
                 en_key_out <= '1';
185
                 sel_in <= '1';
186
                 NEXT_STATE <= S18;
187
              when S18 =>
188
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
189
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
190
                 finish <= '0';
191
                 round <= "010";
192
                 en_key_out <= '0';
193
                 sel_in <= '1';
194
                 NEXT_STATE <= S19;
195
              when S19 =>
196
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
197
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
198
                 finish <= '0';
199
                 round <= "010";
200
                 en_key_out <= '0';
201
                 sel_in <= '1';
202
                 NEXT_STATE <= S20;
203
              when S20 =>
204
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
205
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
206
                 finish <= '0';
207
                 round <= "010";
208
                 en_key_out <= '0';
209
                 sel_in <= '1';
210
                 NEXT_STATE <= S21;
211
              when S21 =>
212
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
213
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
214
                 finish <= '0';
215
                 round <= "010";
216
                 en_key_out <= '0';
217
                 sel_in <= '1';
218
                 NEXT_STATE <= S22;
219
              when S22 =>
220
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
221
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
222
                 finish <= '0';
223
                 round <= "010";
224
                 en_key_out <= '0';
225
                 sel_in <= '1';
226
                 NEXT_STATE <= S23;
227
              when S23 =>
228
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
229
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
230
                 finish <= '0';
231
                 round <= "010";
232
                 en_key_out <= '0';
233
                 sel_in <= '1';
234
                 NEXT_STATE <= S24;
235
              when S24 =>
236
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
237
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
238
                 finish <= '0';
239
                 round <= "010";
240
                 en_key_out <= '0';
241
                 sel_in <= '1';
242
                 NEXT_STATE <= S25;
243
-- round 4 --
244
              when S25 =>
245
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
246
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
247
                 finish <= '0';
248
                 round <= "011";
249
                 en_key_out <= '1';
250
                 sel_in <= '1';
251
                 NEXT_STATE <= S26;
252
              when S26 =>
253
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
254
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
255
                 finish <= '0';
256
                 round <= "011";
257
                 en_key_out <= '0';
258
                 sel_in <= '1';
259
                 NEXT_STATE <= S27;
260
              when S27 =>
261
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
262
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
263
                 finish <= '0';
264
                 round <= "011";
265
                 en_key_out <= '0';
266
                 sel_in <= '1';
267
                 NEXT_STATE <= S28;
268
              when S28 =>
269
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
270
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
271
                 finish <= '0';
272
                 round <= "011";
273
                 en_key_out <= '0';
274
                 sel_in <= '1';
275
                 NEXT_STATE <= S29;
276
              when S29 =>
277
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
278
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
279
                 finish <= '0';
280
                 round <= "011";
281
                 en_key_out <= '0';
282
                 sel_in <= '1';
283
                 NEXT_STATE <= S30;
284
              when S30 =>
285
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
286
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
287
                 finish <= '0';
288
                 round <= "011";
289
                 en_key_out <= '0';
290
                 sel_in <= '1';
291
                 NEXT_STATE <= S31;
292
              when S31 =>
293
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
294
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
295
                 finish <= '0';
296
                 round <= "011";
297
                 en_key_out <= '0';
298
                 sel_in <= '1';
299
                 NEXT_STATE <= S32;
300
              when S32 =>
301
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
302
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
303
                 finish <= '0';
304
                 round <= "011";
305
                 en_key_out <= '0';
306
                 sel_in <= '1';
307
                 NEXT_STATE <= S33;
308
-- round 5 --
309
              when S33 =>
310
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
311
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
312
                 finish <= '0';
313
                 round <= "100";
314
                 en_key_out <= '1';
315
                 sel_in <= '1';
316
                 NEXT_STATE <= S34;
317
              when S34 =>
318
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
319
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
320
                 finish <= '0';
321
                 round <= "100";
322
                 en_key_out <= '0';
323
                 sel_in <= '1';
324
                 NEXT_STATE <= S35;
325
              when S35 =>
326
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
327
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
328
                 finish <= '0';
329
                 round <= "100";
330
                 en_key_out <= '0';
331
                 sel_in <= '1';
332
                 NEXT_STATE <= S36;
333
              when S36 =>
334
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
335
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
336
                 finish <= '0';
337
                 round <= "100";
338
                 en_key_out <= '0';
339
                 sel_in <= '1';
340
                 NEXT_STATE <= S37;
341
              when S37 =>
342
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
343
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
344
                 finish <= '0';
345
                 round <= "100";
346
                 en_key_out <= '0';
347
                 sel_in <= '1';
348
                 NEXT_STATE <= S38;
349
              when S38 =>
350
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
351
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
352
                 finish <= '0';
353
                 round <= "100";
354
                 en_key_out <= '0';
355
                 sel_in <= '1';
356
                 NEXT_STATE <= S39;
357
              when S39 =>
358
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
359
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
360
                 finish <= '0';
361
                 round <= "100";
362
                 en_key_out <= '0';
363
                 sel_in <= '1';
364
                 NEXT_STATE <= S40;
365
              when S40 =>
366
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
367
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
368
                 finish <= '0';
369
                 round <= "100";
370
                 en_key_out <= '0';
371
                 sel_in <= '1';
372
                 NEXT_STATE <= S41;
373
-- round 6 --
374
              when S41 =>
375
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
376
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
377
                 finish <= '0';
378
                 round <= "101";
379
                 en_key_out <= '1';
380
                 sel_in <= '1';
381
                 NEXT_STATE <= S42;
382
              when S42 =>
383
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
384
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
385
                 finish <= '0';
386
                 round <= "101";
387
                 en_key_out <= '0';
388
                 sel_in <= '1';
389
                 NEXT_STATE <= S43;
390
              when S43 =>
391
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
392
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
393
                 finish <= '0';
394
                 round <= "101";
395
                 en_key_out <= '0';
396
                 sel_in <= '1';
397
                 NEXT_STATE <= S44;
398
              when S44 =>
399
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
400
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
401
                 finish <= '0';
402
                 round <= "101";
403
                 en_key_out <= '0';
404
                 sel_in <= '1';
405
                 NEXT_STATE <= S45;
406
              when S45 =>
407
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
408
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
409
                 finish <= '0';
410
                 round <= "101";
411
                 en_key_out <= '0';
412
                 sel_in <= '1';
413
                 NEXT_STATE <= S46;
414
              when S46 =>
415
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
416
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
417
                 finish <= '0';
418
                 round <= "101";
419
                 en_key_out <= '0';
420
                 sel_in <= '1';
421
                 NEXT_STATE <= S47;
422
              when S47 =>
423
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
424
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
425
                 finish <= '0';
426
                 round <= "101";
427
                 en_key_out <= '0';
428
                 sel_in <= '1';
429
                 NEXT_STATE <= S48;
430
              when S48 =>
431
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
432
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
433
                 finish <= '0';
434
                 round <= "101";
435
                 en_key_out <= '0';
436
                 sel_in <= '1';
437
                 NEXT_STATE <= S49;
438
-- round 7 --
439
             when S49 =>
440
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
441
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
442
                 finish <= '0';
443
                 round <= "110";
444
                 en_key_out <= '1';
445
                 sel_in <= '1';
446
                 NEXT_STATE <= S50;
447
              when S50 =>
448
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
449
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
450
                 finish <= '0';
451
                 round <= "110";
452
                 en_key_out <= '0';
453
                 sel_in <= '1';
454
                 NEXT_STATE <= S51;
455
              when S51 =>
456
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
457
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
458
                 finish <= '0';
459
                 round <= "110";
460
                 en_key_out <= '0';
461
                 sel_in <= '1';
462
                 NEXT_STATE <= S52;
463
              when S52 =>
464
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
465
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
466
                 finish <= '0';
467
                 round <= "110";
468
                 en_key_out <= '0';
469
                 sel_in <= '1';
470
                 NEXT_STATE <= S53;
471
              when S53 =>
472
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
473
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
474
                 finish <= '0';
475
                 round <= "110";
476
                 en_key_out <= '0';
477
                 sel_in <= '1';
478
                 NEXT_STATE <= S54;
479
              when S54 =>
480
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
481
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
482
                 finish <= '0';
483
                 round <= "110";
484
                 en_key_out <= '0';
485
                 sel_in <= '1';
486
                 NEXT_STATE <= S55;
487
              when S55 =>
488
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
489
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
490
                 finish <= '0';
491
                 round <= "110";
492
                 en_key_out <= '0';
493
                 sel_in <= '1';
494
                 NEXT_STATE <= S56;
495
              when S56 =>
496
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
497
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
498
                 finish <= '0';
499
                 round <= "110";
500
                 en_key_out <= '0';
501
                 sel_in <= '1';
502
                 NEXT_STATE <= S57;
503
-- round 8 --
504
              when S57 =>
505
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
506
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
507
                 finish <= '0';
508
                 round <= "111";
509
                 en_key_out <= '1';
510
                 sel_in <= '1';
511
                 NEXT_STATE <= S58;
512
              when S58 =>
513
                 en1 <= '1'; en2 <= '0'; en3 <= '0'; en4 <= '0';
514
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
515
                 finish <= '0';
516
                 round <= "111";
517
                 en_key_out <= '0';
518
                 sel_in <= '1';
519
                 NEXT_STATE <= S59;
520
              when S59 =>
521
                 en1 <= '0'; en2 <= '1'; en3 <= '0'; en4 <= '0';
522
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
523
                 finish <= '0';
524
                 round <= "111";
525
                 en_key_out <= '0';
526
                 sel_in <= '1';
527
                 NEXT_STATE <= S60;
528
              when S60 =>
529
                 en1 <= '0'; en2 <= '0'; en3 <= '1'; en4 <= '0';
530
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
531
                 finish <= '0';
532
                 round <= "111";
533
                 en_key_out <= '0';
534
                 sel_in <= '1';
535
                 NEXT_STATE <= S61;
536
              when S61 =>
537
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '1';
538
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
539
                 finish <= '0';
540
                 round <= "111";
541
                 en_key_out <= '0';
542
                 sel_in <= '1';
543
                 NEXT_STATE <= S62;
544
              when S62 =>
545
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
546
                 en5 <= '1'; en6 <= '0'; en7 <= '0'; en_out <= '0';
547
                 finish <= '0';
548
                 round <= "111";
549
                 en_key_out <= '0';
550
                 sel_in <= '1';
551
                 NEXT_STATE <= S63;
552
              when S63 =>
553
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
554
                 en5 <= '0'; en6 <= '1'; en7 <= '0'; en_out <= '0';
555
                 finish <= '0';
556
                 round <= "111";
557
                 en_key_out <= '0';
558
                 sel_in <= '1';
559
                 NEXT_STATE <= S64;
560
              when S64 =>
561
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
562
                 en5 <= '0'; en6 <= '0'; en7 <= '1'; en_out <= '0';
563
                 finish <= '0';
564
                 round <= "111";
565
                 en_key_out <= '0';
566
                 sel_in <= '1';
567
                 NEXT_STATE <= S65;
568
-- output transformation --
569
              when S65 =>
570
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
571
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
572
                 finish <= '0';
573
                 round <= "111";
574
                 en_key_out <= '1';
575
                 sel_in <= '0';
576
                 NEXT_STATE <= S66;
577
              when S66 =>
578
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
579
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '1';
580
                 finish <= '0';
581
                 round <= "111";
582
                 en_key_out <= '0';
583
                 sel_in <= '0';
584
                 NEXT_STATE <= S67;
585
              when S67 =>
586
                 en1 <= '0'; en2 <= '0'; en3 <= '0'; en4 <= '0';
587
                 en5 <= '0'; en6 <= '0'; en7 <= '0'; en_out <= '0';
588
                 finish <= '1';
589
                 round <= "111";
590
                 en_key_out <= '0';
591
                 sel_in <= '0';
592
                 NEXT_STATE <= S1;
593
              when others =>
594
                 assert('1')
595
                 report "Illegal state";
596
 
597
         end case;
598
      end if;
599
end process;
600
 
601
process (ck)
602
  begin
603
     if ((ck AND NOT ck'STABLE) = '1') then
604
             CURRENT_STATE <= NEXT_STATE;
605
     end if;
606
end process;
607
 
608
end fsm;

powered by: WebSVN 2.1.0

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