1 |
6 |
marta |
-- VHDL data flow description generated from `ecb`
|
2 |
|
|
-- date : Sat Sep 1 20:14:57 2001
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
-- Entity Declaration
|
6 |
|
|
|
7 |
|
|
ENTITY ecb IS
|
8 |
|
|
PORT (
|
9 |
|
|
active : in BIT; -- active
|
10 |
|
|
clk : in BIT; -- clk
|
11 |
|
|
cke : in BIT; -- cke
|
12 |
|
|
key_ready : in BIT; -- key_ready
|
13 |
|
|
finish : in BIT; -- finish
|
14 |
|
|
req_cp : in BIT; -- req_cp
|
15 |
|
|
e : in BIT; -- e
|
16 |
|
|
e_mesin : out BIT; -- e_mesin
|
17 |
|
|
s_mesin : out BIT; -- s_mesin
|
18 |
|
|
s_gen_key : out BIT; -- s_gen_key
|
19 |
|
|
emp_buf : out BIT; -- emp_buf
|
20 |
|
|
cp_ready : out BIT; -- cp_ready
|
21 |
|
|
cke_b_mode : out BIT; -- cke_b_mode
|
22 |
|
|
en_in : out BIT; -- en_in
|
23 |
|
|
en_iv : out BIT; -- en_iv
|
24 |
|
|
en_rcbc : out BIT; -- en_rcbc
|
25 |
|
|
en_out : out BIT; -- en_out
|
26 |
|
|
sel1 : out bit_vector(1 DOWNTO 0) ; -- sel1
|
27 |
|
|
sel2 : out bit_vector(1 DOWNTO 0) ; -- sel2
|
28 |
|
|
sel3 : out bit_vector(1 DOWNTO 0) ; -- sel3
|
29 |
|
|
vdd : in BIT; -- vdd
|
30 |
|
|
vss : in BIT -- vss
|
31 |
|
|
);
|
32 |
|
|
END ecb;
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
-- Architecture Declaration
|
36 |
|
|
|
37 |
|
|
ARCHITECTURE VBE OF ecb IS
|
38 |
|
|
SIGNAL current_state : REG_VECTOR(2 DOWNTO 0) REGISTER; -- current_state
|
39 |
|
|
SIGNAL current_state_s6 : BIT; -- current_state_s6
|
40 |
|
|
SIGNAL next_state_s6 : BIT; -- next_state_s6
|
41 |
|
|
SIGNAL current_state_s5 : BIT; -- current_state_s5
|
42 |
|
|
SIGNAL next_state_s5 : BIT; -- next_state_s5
|
43 |
|
|
SIGNAL current_state_s4 : BIT; -- current_state_s4
|
44 |
|
|
SIGNAL next_state_s4 : BIT; -- next_state_s4
|
45 |
|
|
SIGNAL current_state_s3 : BIT; -- current_state_s3
|
46 |
|
|
SIGNAL next_state_s3 : BIT; -- next_state_s3
|
47 |
|
|
SIGNAL current_state_s2 : BIT; -- current_state_s2
|
48 |
|
|
SIGNAL next_state_s2 : BIT; -- next_state_s2
|
49 |
|
|
SIGNAL current_state_s1 : BIT; -- current_state_s1
|
50 |
|
|
SIGNAL next_state_s1 : BIT; -- next_state_s1
|
51 |
|
|
SIGNAL current_state_s0 : BIT; -- current_state_s0
|
52 |
|
|
SIGNAL next_state_s0 : BIT; -- next_state_s0
|
53 |
|
|
SIGNAL next_state : BIT_VECTOR(2 DOWNTO 0); -- next_state
|
54 |
|
|
|
55 |
|
|
BEGIN
|
56 |
|
|
next_state(0) <= (next_state_s2 OR next_state_s5 OR next_state_s6);
|
57 |
|
|
next_state(1) <= (next_state_s1 OR next_state_s4 OR next_state_s5);
|
58 |
|
|
next_state(2) <= (next_state_s0 OR next_state_s1 OR next_state_s5
|
59 |
|
|
OR next_state_s6);
|
60 |
|
|
next_state_s0 <= (current_state_s0 AND NOT(cke));
|
61 |
|
|
current_state_s0 <= (current_state(2) AND NOT(current_state(1)) AND
|
62 |
|
|
NOT(current_state(0)));
|
63 |
|
|
next_state_s1 <= ((current_state_s0 AND cke) OR (current_state_s1
|
64 |
|
|
AND NOT(key_ready)));
|
65 |
|
|
current_state_s1 <= (current_state(2) AND current_state(1) AND NOT(
|
66 |
|
|
current_state(0)));
|
67 |
|
|
next_state_s2 <= (current_state_s1 AND key_ready);
|
68 |
|
|
current_state_s2 <= (NOT(current_state(2)) AND current_state(0));
|
69 |
|
|
next_state_s3 <= (current_state_s2 OR (current_state_s3 AND NOT(
|
70 |
|
|
finish)));
|
71 |
|
|
current_state_s3 <= (NOT(current_state(2)) AND NOT(current_state(1))
|
72 |
|
|
AND NOT(current_state(0)));
|
73 |
|
|
next_state_s4 <= (current_state_s3 AND finish);
|
74 |
|
|
current_state_s4 <= (NOT(current_state(2)) AND current_state(1));
|
75 |
|
|
next_state_s5 <= (current_state_s4 OR (current_state_s5 AND NOT(
|
76 |
|
|
req_cp)));
|
77 |
|
|
current_state_s5 <= (current_state(1) AND current_state(0));
|
78 |
|
|
next_state_s6 <= ((current_state_s5 AND req_cp) OR
|
79 |
|
|
current_state_s6);
|
80 |
|
|
current_state_s6 <= (current_state(2) AND NOT(current_state(1)) AND
|
81 |
|
|
current_state(0));
|
82 |
|
|
label0 : BLOCK ((NOT((clk'STABLE)) AND NOT(clk)) = '1')
|
83 |
|
|
BEGIN
|
84 |
|
|
current_state(0) <= GUARDED (next_state(0) AND NOT(active));
|
85 |
|
|
END BLOCK label0;
|
86 |
|
|
label1 : BLOCK ((NOT((clk'STABLE)) AND NOT(clk)) = '1')
|
87 |
|
|
BEGIN
|
88 |
|
|
current_state(1) <= GUARDED (next_state(1) AND NOT(active));
|
89 |
|
|
END BLOCK label1;
|
90 |
|
|
label2 : BLOCK ((NOT((clk'STABLE)) AND NOT(clk)) = '1')
|
91 |
|
|
BEGIN
|
92 |
|
|
current_state(2) <= GUARDED (next_state(2) OR active);
|
93 |
|
|
END BLOCK label2;
|
94 |
|
|
|
95 |
|
|
sel3(0) <= '0';
|
96 |
|
|
|
97 |
|
|
sel3(1) <= (active OR (current_state_s0 AND NOT(active)) OR
|
98 |
|
|
(current_state_s1 AND NOT(active)) OR (
|
99 |
|
|
current_state_s2 AND NOT(active)) OR (current_state_s3 AND NOT(
|
100 |
|
|
active)) OR (current_state_s4 AND NOT(active)) OR (
|
101 |
|
|
current_state_s5 AND NOT(active)) OR (current_state_s6 AND NOT(
|
102 |
|
|
active)));
|
103 |
|
|
|
104 |
|
|
sel2(0) <= '0';
|
105 |
|
|
|
106 |
|
|
sel2(1) <= (active OR (current_state_s0 AND NOT(active)) OR
|
107 |
|
|
(current_state_s1 AND NOT(active)) OR (
|
108 |
|
|
current_state_s2 AND NOT(active)) OR (current_state_s3 AND NOT(
|
109 |
|
|
active)) OR (current_state_s4 AND NOT(active)) OR (
|
110 |
|
|
current_state_s5 AND NOT(active)) OR (current_state_s6 AND NOT(
|
111 |
|
|
active)));
|
112 |
|
|
|
113 |
|
|
sel1(0) <= ((current_state_s2 AND NOT(active)) OR (
|
114 |
|
|
current_state_s3 AND NOT(active)) OR (current_state_s4 AND NOT(
|
115 |
|
|
active)) OR (current_state_s5 AND NOT(active)) OR (
|
116 |
|
|
current_state_s6 AND NOT(active)));
|
117 |
|
|
|
118 |
|
|
sel1(1) <= (active OR (current_state_s0 AND NOT(active)) OR
|
119 |
|
|
(current_state_s1 AND NOT(active)));
|
120 |
|
|
|
121 |
|
|
en_out <= (current_state_s3 AND NOT(active) AND finish);
|
122 |
|
|
|
123 |
|
|
en_rcbc <= '0';
|
124 |
|
|
|
125 |
|
|
en_iv <= '0';
|
126 |
|
|
|
127 |
|
|
en_in <= (current_state_s1 AND NOT(active) AND key_ready);
|
128 |
|
|
|
129 |
|
|
cke_b_mode <= ((current_state_s0 AND NOT(active) AND cke) OR (
|
130 |
|
|
current_state_s1 AND NOT(active)) OR (current_state_s2 AND NOT(
|
131 |
|
|
active)) OR (current_state_s3 AND NOT(active)) OR (
|
132 |
|
|
current_state_s4 AND NOT(active)) OR (current_state_s5 AND NOT(
|
133 |
|
|
active)) OR (current_state_s6 AND NOT(active)));
|
134 |
|
|
|
135 |
|
|
cp_ready <= ((current_state_s4 AND NOT(active)) OR (
|
136 |
|
|
current_state_s5 AND NOT(active) AND NOT(req_cp)));
|
137 |
|
|
|
138 |
|
|
emp_buf <= ((current_state_s2 AND NOT(active)) OR (
|
139 |
|
|
current_state_s3 AND NOT(active) AND NOT(finish)));
|
140 |
|
|
|
141 |
|
|
s_gen_key <= ((current_state_s0 AND NOT(active) AND cke) OR (
|
142 |
|
|
current_state_s1 AND NOT(active)) OR (current_state_s2 AND NOT(
|
143 |
|
|
active)) OR (current_state_s3 AND NOT(active)) OR (
|
144 |
|
|
current_state_s4 AND NOT(active)) OR (current_state_s5 AND NOT(
|
145 |
|
|
active)) OR (current_state_s6 AND NOT(active)));
|
146 |
|
|
|
147 |
|
|
s_mesin <= ((current_state_s2 AND NOT(active)) OR (
|
148 |
|
|
current_state_s3 AND NOT(active) AND NOT(finish)));
|
149 |
|
|
|
150 |
|
|
e_mesin <= ((e AND active) OR (current_state_s0 AND e AND
|
151 |
|
|
NOT(active)) OR (current_state_s1 AND e AND NOT(
|
152 |
|
|
active)) OR (current_state_s2 AND e AND NOT(active)) OR
|
153 |
|
|
(current_state_s3 AND e AND NOT(active)) OR (
|
154 |
|
|
current_state_s4 AND e AND NOT(active)) OR (current_state_s5 AND
|
155 |
|
|
e AND NOT(active)) OR (current_state_s6 AND e AND
|
156 |
|
|
NOT(active)));
|
157 |
|
|
END;
|