-
Notifications
You must be signed in to change notification settings - Fork 5
/
general_components.vhd
138 lines (128 loc) · 4.52 KB
/
general_components.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
library std;
library ieee;
use ieee.std_logic_1164.all;
package general_components is
component DataRegister is
generic (data_width:integer);
port (Din: in std_logic_vector(data_width-1 downto 0);
Dout: out std_logic_vector(data_width-1 downto 0);
clk, enable: in std_logic);
end component DataRegister;
component subtractor4 is
port (a,b: in std_logic_vector(3 downto 0); c: out std_logic_vector(3 downto 0));
end component subtractor4;
component dividerdp is
port(t: in std_logic_vector(0 to 10);
s: out std_logic;
a: in std_logic_vector(16 downto 0);
b: in std_logic_vector(8 downto 0);
q: out std_logic_vector(7 downto 0);
r: out std_logic_vector(7 downto 0);
clk: in std_logic);
end component;
component dividercp is
port(done,input_ack: out std_logic;
clk,reset,start,output_ack: in std_logic;
t: out std_logic_vector(0 to 10);
s: in std_logic);
end component;
component checker is
port(a: in std_logic_vector(8 downto 0);
b: in std_logic_vector(8 downto 0);
c: out std_logic);
end component;
component simplemul is
port (a,b: in std_logic_vector(7 downto 0); c: out std_logic_vector(14 downto 0));
end component;
component divider is
port(dividend: in std_logic_vector(16 downto 0);
divisor: in std_logic_vector(8 downto 0);
q: out std_logic_vector(7 downto 0);
r: out std_logic_vector(7 downto 0);
done,input_ack: out std_logic;
clk,reset,start,output_ack: in std_logic);
end component;
component inverterControlPath is
port ( T:out std_logic_vector(0 to 14);
dvdr_start,dvdr_output_ack: out std_logic;
S,dvdr_input_ack,dvdr_done: in std_logic;
start,output_ack: in std_logic;
input_ack,done : out std_logic;
clk, reset: in std_logic
);
end component;
component inverterDataPath is
port ( T: in std_logic_vector(0 to 14);
dvdr_start,dvdr_output_ack: in std_logic;
S,dvdr_input_ack,dvdr_done: out std_logic;
a: in std_logic_vector(7 downto 0);
b: out std_logic_vector(7 downto 0);
ir_polynom: in std_logic_vector(8 downto 0);
clk, reset: in std_logic
);
end component;
component inverter is
port(a: in std_logic_vector(7 downto 0);
b: out std_logic_vector(7 downto 0);
ir_polynom: in std_logic_vector(8 downto 0);
start,output_ack: in std_logic;
input_ack,done: out std_logic;
clk, reset: in std_logic);
end component;
component sbox is
port(input: in std_logic_vector(7 downto 0);
output: out std_logic_vector(7 downto 0);
ir_polynom: in std_logic_vector(8 downto 0);
start,output_ack: in std_logic;
input_ack,done: out std_logic;
clk, reset: in std_logic);
end component;
component mixcol is
port(a: in std_logic_vector(31 downto 0);
b: out std_logic_vector(31 downto 0);
ir_polynom: in std_logic_vector(8 downto 0);
start,clk,reset,output_ack: in std_logic;
done: out std_logic);
end component;
component shiftrow is
port(x: in std_logic_vector(127 downto 0);
y: out std_logic_vector(127 downto 0));
end component;
component rkeygendp is
port(t: in std_logic_vector(0 to 7);
s: out std_logic_vector(0 to 1);
ir_polynom: in std_logic_vector(8 downto 0);
clk,dvdr_start,dvdr_output_ack,reset,sbox_start,sbox_opack: in std_logic;
dvdr_done,sbox_done: out std_logic;
key:in std_logic_vector(127 downto 0);
round_key:out std_logic_vector(127 downto 0));
end component;
component rkeygencp is
port(s: in std_logic_vector(0 to 1);
t: out std_logic_vector(0 to 7);
clk,reset,key_ack,start,dvdr_done,sbox_done: in std_logic;
done,dvdr_output_ack,dvdr_start,sbox_start,sbox_opack: out std_logic);
end component;
component rkeygen is
port( key:in std_logic_vector(127 downto 0);
ir_polynom: in std_logic_vector(8 downto 0);
done:out std_logic;
clk,reset,key_ack,start:in std_logic;
round_key:out std_logic_vector(127 downto 0));
end component;
component encryptdp is
port(t: in std_logic_vector(0 to 7);
s,s2: out std_logic;
plaindata,key: in std_logic_vector(127 downto 0);
cipherdata: out std_logic_vector(127 downto 0);
ir_polynom: in std_logic_vector(8 downto 0);
mixcol_done,keygen_done,sbox_done: out std_logic;
mixcol_start,mixcol_opack,sbox_start,sbox_opack,keygen_start,key_ack,reset,clk,p2: in std_logic);
end component;
component encryptcp is
port(t: out std_logic_vector(0 to 7);
s,s2: in std_logic;
start,mixcol_done,keygen_done,reset,clk,sbox_done: in std_logic;
done,mixcol_start,mixcol_opack,key_ack,p2,sbox_start,sbox_opack: out std_logic);
end component;
end package;