-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathECMP.vhd
More file actions
195 lines (159 loc) · 7.33 KB
/
ECMP.vhd
File metadata and controls
195 lines (159 loc) · 7.33 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--Error-Correction Memory Path
entity ECMP is
Port ( clk : in STD_LOGIC;
wr_en1 : in STD_LOGIC;
re_en1 : in STD_LOGIC;
wr_add1 : in STD_LOGIC_VECTOR (3 downto 0);
re_add1 : in STD_LOGIC_VECTOR (3 downto 0);
reset1 : in STD_LOGIC;
wr_en2 : in STD_LOGIC;
re_en2 : in STD_LOGIC;
wr_add2 : in STD_LOGIC_VECTOR (3 downto 0);
re_add2 : in STD_LOGIC_VECTOR (3 downto 0);
reset2 : in STD_LOGIC;
reg1_out : out STD_LOGIC_VECTOR (15 downto 0);
reg1_load : in STD_LOGIC;
reg1_clear : in STD_LOGIC;
reg2_out : out STD_LOGIC_VECTOR (15 downto 0);
reg2_load : in STD_LOGIC;
reg2_clear : in STD_LOGIC;
noise_num1 : in STD_LOGIC_VECTOR (3 downto 0);
noise_en1 : in STD_LOGIC;
noise_num2 : in STD_LOGIC_VECTOR (3 downto 0);
noise_en2 : in STD_LOGIC;
buff_noise1_en : in STD_LOGIC;
buff_noise2_en : in STD_LOGIC;
buff_reg1_en : in STD_LOGIC;
buff_reg2_en : in STD_LOGIC;
buff_decoder1_en : in STD_LOGIC;
buff_decoder2_en : in STD_LOGIC;
data_bus : inout STD_LOGIC_VECTOR (15 downto 0);
outter_in : in STD_LOGIC_VECTOR (10 downto 0));
end ECMP;
architecture Behavioral of ECMP is
component Buffer16 is
Port ( x : in STD_LOGIC_VECTOR (15 downto 0);
y : out STD_LOGIC_VECTOR (15 downto 0);
en : in STD_LOGIC);
end component;
component DPRAM is
Port ( clk : in STD_LOGIC;
wr_en : in STD_LOGIC;
re_en : in STD_LOGIC;
reset : in STD_LOGIC;
wr_add : in STD_LOGIC_VECTOR (3 downto 0);
re_add : in STD_LOGIC_VECTOR (3 downto 0);
wr_data : in STD_LOGIC_VECTOR (10 downto 0);
re_data : out STD_LOGIC_VECTOR (10 downto 0));
end component;
component HammingDecoder is
Port ( x : in STD_LOGIC_VECTOR (15 downto 0);
y : out STD_LOGIC_VECTOR (10 downto 0);
clk : in STD_LOGIC);
end component;
component HammingEncoder is
Port ( x : in STD_LOGIC_VECTOR (10 downto 0);
y : out STD_LOGIC_VECTOR (15 downto 0);
clk : in STD_LOGIC);
end component;
component NoiseElement is
Port ( clk : in STD_LOGIC;
x : in STD_LOGIC_VECTOR (15 downto 0);
y : out STD_LOGIC_VECTOR (15 downto 0);
num : in STD_LOGIC_VECTOR (3 downto 0);
en : in STD_LOGIC);
end component;
component Register16 is
Port ( clk : in STD_LOGIC;
x : in STD_LOGIC_VECTOR (15 downto 0);
y : out STD_LOGIC_VECTOR (15 downto 0);
load : in STD_LOGIC;
clear : in STD_LOGIC);
end component;
signal wr_data1: std_logic_vector(10 downto 0);
signal re_data1: std_logic_vector(10 downto 0);
signal wr_data2: std_logic_vector(10 downto 0);
signal re_data2: std_logic_vector(10 downto 0);
signal enc1_out_noise1_in: std_logic_vector(15 downto 0);
signal enc2_out_noise2_in: std_logic_vector(15 downto 0);
signal noise1_out_buff_in: std_logic_vector(15 downto 0);
signal noise2_out_buff_in: std_logic_vector(15 downto 0);
signal reg1_in_buff_out: std_logic_vector(15 downto 0);
signal reg2_in_buff_out: std_logic_vector(15 downto 0);
signal dec1_in_buff_out: std_logic_vector(15 downto 0);
signal dec2_in_buff_out: std_logic_vector(15 downto 0);
begin
Dual_Port_RAM1: DPRAM port map( clk => clk,
wr_en => wr_en1,
re_en => re_en1,
reset => reset1,
wr_add => wr_add1,
re_add => re_add1,
wr_data => wr_data1,
re_data => re_data1);
Dual_Port_RAM2: DPRAM port map( clk => clk,
wr_en => wr_en2,
re_en => re_en2,
reset => reset2,
wr_add => wr_add2,
re_add => re_add2,
wr_data => wr_data2,
re_data => re_data2);
Noise1: NoiseElement port map( clk => clk,
x => enc1_out_noise1_in,
y => noise1_out_buff_in,
num => noise_num1,
en => noise_en1);
Noise2: NoiseElement port map( clk => clk,
x => enc2_out_noise2_in,
y => noise2_out_buff_in,
num => noise_num2,
en => noise_en2);
reg1: Register16 port map( clk => clk,
x => reg1_in_buff_out,
y => reg1_out,
load => reg1_load,
clear => reg1_clear);
reg2: Register16 port map( clk => clk,
x => reg2_in_buff_out,
y => reg2_out,
load => reg2_load,
clear => reg2_clear);
buff_noise1: Buffer16 port map( x => noise1_out_buff_in,
y => data_bus,
en => buff_noise1_en);
buff_noise2: Buffer16 port map( x => noise2_out_buff_in,
y => data_bus,
en => buff_noise2_en);
buff_reg1: Buffer16 port map( x => data_bus,
y => reg1_in_buff_out,
en => buff_reg1_en);
buff_reg2: Buffer16 port map( x => data_bus,
y => reg2_in_buff_out,
en => buff_reg2_en);
buff_bus1: Buffer16 port map( x => data_bus,
y => dec1_in_buff_out,
en => buff_decoder1_en);
buff_bus2: Buffer16 port map( x => data_bus,
y => dec2_in_buff_out,
en => buff_decoder2_en);
encoder1: HammingEncoder port map( clk => clk,
x => re_data1,
y => enc1_out_noise1_in);
encoder2: HammingEncoder port map( clk => clk,
x => re_data2,
y => enc2_out_noise2_in);
encoder3: HammingEncoder port map( clk => clk,
x => outter_in,
y => data_bus);
decoder1: HammingDecoder port map( clk => clk,
x => dec1_in_buff_out,
y => wr_data1);
decoder2: HammingDecoder port map( clk => clk,
x => dec2_in_buff_out,
y => wr_data2);
end Behavioral;