1 | -- -------------------------------------------------------------
|
2 | --
|
3 | -- Module: lowpass0_05
|
4 | -- Generated by MATLAB(R) 8.5 and the Filter Design HDL Coder 2.9.7.
|
5 | -- Generated on: 2015-07-13 13:25:46
|
6 | -- -------------------------------------------------------------
|
7 |
|
8 | -- -------------------------------------------------------------
|
9 | -- HDL Code Generation Options:
|
10 | --
|
11 | -- TargetLanguage: VHDL
|
12 | -- Name: lowpass0_05
|
13 | -- TestBenchStimulus: step ramp chirp
|
14 |
|
15 | -- Filter Specifications:
|
16 | --
|
17 | -- Sample Rate : N/A (normalized frequency)
|
18 | -- Response : Lowpass
|
19 | -- Specification : Nb,Na,F3dB
|
20 | -- NumOrder : 8
|
21 | -- DenOrder : 8
|
22 | -- 3-dB Point : 0.05
|
23 | -- -------------------------------------------------------------
|
24 |
|
25 | -- -------------------------------------------------------------
|
26 | -- HDL Implementation : Fully parallel
|
27 | -- Multipliers : 17
|
28 | -- Folding Factor : 1
|
29 | -- -------------------------------------------------------------
|
30 | -- Filter Settings:
|
31 | --
|
32 | -- Discrete-Time IIR Filter (real)
|
33 | -- -------------------------------
|
34 | -- Filter Structure : Direct-Form II, Second-Order Sections
|
35 | -- Number of Sections : 4
|
36 | -- Stable : Yes
|
37 | -- Linear Phase : No
|
38 | -- Arithmetic : fixed
|
39 | -- Numerator : s18,15 -> [-4 4)
|
40 | -- Denominator : s18,16 -> [-2 2)
|
41 | -- Scale Values : s18,46 -> [-1.862645e-09 1.862645e-09)
|
42 | -- Input : s32,31 -> [-1 1)
|
43 | -- Section Input : s18,40 -> [-1.192093e-07 1.192093e-07)
|
44 | -- Section Output : s16,10 -> [-32 32)
|
45 | -- Output : s32,26 -> [-32 32)
|
46 | -- State : s16,15 -> [-1 1)
|
47 | -- Numerator Prod : s32,30 -> [-2 2)
|
48 | -- Denominator Prod : s32,29 -> [-4 4)
|
49 | -- Numerator Accum : s40,30 -> [-512 512)
|
50 | -- Denominator Accum : s40,29 -> [-1024 1024)
|
51 | -- Round Mode : convergent
|
52 | -- Overflow Mode : wrap
|
53 | -- Cast Before Sum : true
|
54 | -- -------------------------------------------------------------
|
55 | LIBRARY IEEE;
|
56 | USE IEEE.std_logic_1164.all;
|
57 | USE IEEE.numeric_std.ALL;
|
58 |
|
59 | ENTITY lowpass0_05 IS
|
60 | PORT( clk : IN std_logic;
|
61 | clk_enable : IN std_logic;
|
62 | reset : IN std_logic;
|
63 | filter_in : IN std_logic_vector(31 DOWNTO 0); -- sfix32_En31
|
64 | filter_out : OUT std_logic_vector(31 DOWNTO 0) -- sfix32_En26
|
65 | );
|
66 |
|
67 | END lowpass0_05;
|
68 |
|
69 |
|
70 | ----------------------------------------------------------------
|
71 | --Module Architecture: lowpass0_05
|
72 | ----------------------------------------------------------------
|
73 | ARCHITECTURE rtl OF lowpass0_05 IS
|
74 | -- Local Functions
|
75 | -- Type Definitions
|
76 | TYPE delay_pipeline_type IS ARRAY (NATURAL range <>) OF signed(15 DOWNTO 0); -- sfix16_En15
|
77 | -- Constants
|
78 | CONSTANT scaleconst1 : signed(17 DOWNTO 0) := to_signed(69212, 18); -- sfix18_En46
|
79 | CONSTANT coeff_b1_section1 : signed(17 DOWNTO 0) := to_signed(32768, 18); -- sfix18_En15
|
80 | CONSTANT coeff_b2_section1 : signed(17 DOWNTO 0) := to_signed(65556, 18); -- sfix18_En15
|
81 | CONSTANT coeff_b3_section1 : signed(17 DOWNTO 0) := to_signed(32778, 18); -- sfix18_En15
|
82 | CONSTANT coeff_a2_section1 : signed(17 DOWNTO 0) := to_signed(-112238, 18); -- sfix18_En16
|
83 | CONSTANT coeff_a3_section1 : signed(17 DOWNTO 0) := to_signed(48101, 18); -- sfix18_En16
|
84 | CONSTANT coeff_b1_section2 : signed(17 DOWNTO 0) := to_signed(32768, 18); -- sfix18_En15
|
85 | CONSTANT coeff_b2_section2 : signed(17 DOWNTO 0) := to_signed(66356, 18); -- sfix18_En15
|
86 | CONSTANT coeff_b3_section2 : signed(17 DOWNTO 0) := to_signed(33598, 18); -- sfix18_En15
|
87 | CONSTANT coeff_a2_section2 : signed(17 DOWNTO 0) := to_signed(-114558, 18); -- sfix18_En16
|
88 | CONSTANT coeff_a3_section2 : signed(17 DOWNTO 0) := to_signed(50450, 18); -- sfix18_En16
|
89 | CONSTANT coeff_b1_section3 : signed(17 DOWNTO 0) := to_signed(32768, 18); -- sfix18_En15
|
90 | CONSTANT coeff_b2_section3 : signed(17 DOWNTO 0) := to_signed(65516, 18); -- sfix18_En15
|
91 | CONSTANT coeff_b3_section3 : signed(17 DOWNTO 0) := to_signed(32758, 18); -- sfix18_En15
|
92 | CONSTANT coeff_a2_section3 : signed(17 DOWNTO 0) := to_signed(-119107, 18); -- sfix18_En16
|
93 | CONSTANT coeff_a3_section3 : signed(17 DOWNTO 0) := to_signed(55055, 18); -- sfix18_En16
|
94 | CONSTANT coeff_b1_section4 : signed(17 DOWNTO 0) := to_signed(32768, 18); -- sfix18_En15
|
95 | CONSTANT coeff_b2_section4 : signed(17 DOWNTO 0) := to_signed(64716, 18); -- sfix18_En15
|
96 | CONSTANT coeff_b3_section4 : signed(17 DOWNTO 0) := to_signed(31958, 18); -- sfix18_En15
|
97 | CONSTANT coeff_a2_section4 : signed(17 DOWNTO 0) := to_signed(-125624, 18); -- sfix18_En16
|
98 | CONSTANT coeff_a3_section4 : signed(17 DOWNTO 0) := to_signed(61654, 18); -- sfix18_En16
|
99 | -- Signals
|
100 | SIGNAL input_register : signed(31 DOWNTO 0); -- sfix32_En31
|
101 | SIGNAL scale1 : signed(54 DOWNTO 0); -- sfix55_En77
|
102 | SIGNAL mul_temp : signed(49 DOWNTO 0); -- sfix50_En77
|
103 | SIGNAL scaletypeconvert1 : signed(17 DOWNTO 0); -- sfix18_En40
|
104 | -- Section 1 Signals
|
105 | SIGNAL a1sum1 : signed(39 DOWNTO 0); -- sfix40_En29
|
106 | SIGNAL a2sum1 : signed(39 DOWNTO 0); -- sfix40_En29
|
107 | SIGNAL b1sum1 : signed(39 DOWNTO 0); -- sfix40_En30
|
108 | SIGNAL b2sum1 : signed(39 DOWNTO 0); -- sfix40_En30
|
109 | SIGNAL typeconvert1 : signed(15 DOWNTO 0); -- sfix16_En15
|
110 | SIGNAL delay_section1 : delay_pipeline_type(0 TO 1); -- sfix16_En15
|
111 | SIGNAL inputconv1 : signed(39 DOWNTO 0); -- sfix40_En29
|
112 | SIGNAL a2mul1 : signed(31 DOWNTO 0); -- sfix32_En29
|
113 | SIGNAL a3mul1 : signed(31 DOWNTO 0); -- sfix32_En29
|
114 | SIGNAL b1mul1 : signed(31 DOWNTO 0); -- sfix32_En30
|
115 | SIGNAL b2mul1 : signed(31 DOWNTO 0); -- sfix32_En30
|
116 | SIGNAL b3mul1 : signed(31 DOWNTO 0); -- sfix32_En30
|
117 | SIGNAL mul_temp_1 : signed(33 DOWNTO 0); -- sfix34_En31
|
118 | SIGNAL mul_temp_2 : signed(33 DOWNTO 0); -- sfix34_En31
|
119 | SIGNAL mul_temp_3 : signed(33 DOWNTO 0); -- sfix34_En30
|
120 | SIGNAL mul_temp_4 : signed(33 DOWNTO 0); -- sfix34_En30
|
121 | SIGNAL sub_cast : signed(39 DOWNTO 0); -- sfix40_En29
|
122 | SIGNAL sub_cast_1 : signed(39 DOWNTO 0); -- sfix40_En29
|
123 | SIGNAL sub_temp : signed(40 DOWNTO 0); -- sfix41_En29
|
124 | SIGNAL sub_cast_2 : signed(39 DOWNTO 0); -- sfix40_En29
|
125 | SIGNAL sub_cast_3 : signed(39 DOWNTO 0); -- sfix40_En29
|
126 | SIGNAL sub_temp_1 : signed(40 DOWNTO 0); -- sfix41_En29
|
127 | SIGNAL b1multypeconvert1 : signed(39 DOWNTO 0); -- sfix40_En30
|
128 | SIGNAL add_cast : signed(39 DOWNTO 0); -- sfix40_En30
|
129 | SIGNAL add_cast_1 : signed(39 DOWNTO 0); -- sfix40_En30
|
130 | SIGNAL add_temp : signed(40 DOWNTO 0); -- sfix41_En30
|
131 | SIGNAL add_cast_2 : signed(39 DOWNTO 0); -- sfix40_En30
|
132 | SIGNAL add_cast_3 : signed(39 DOWNTO 0); -- sfix40_En30
|
133 | SIGNAL add_temp_1 : signed(40 DOWNTO 0); -- sfix41_En30
|
134 | SIGNAL section_result1 : signed(39 DOWNTO 0); -- sfix40_En29
|
135 | -- Section 2 Signals
|
136 | SIGNAL a1sum2 : signed(39 DOWNTO 0); -- sfix40_En29
|
137 | SIGNAL a2sum2 : signed(39 DOWNTO 0); -- sfix40_En29
|
138 | SIGNAL b1sum2 : signed(39 DOWNTO 0); -- sfix40_En30
|
139 | SIGNAL b2sum2 : signed(39 DOWNTO 0); -- sfix40_En30
|
140 | SIGNAL typeconvert2 : signed(15 DOWNTO 0); -- sfix16_En15
|
141 | SIGNAL delay_section2 : delay_pipeline_type(0 TO 1); -- sfix16_En15
|
142 | SIGNAL inputconv2 : signed(39 DOWNTO 0); -- sfix40_En29
|
143 | SIGNAL a2mul2 : signed(31 DOWNTO 0); -- sfix32_En29
|
144 | SIGNAL a3mul2 : signed(31 DOWNTO 0); -- sfix32_En29
|
145 | SIGNAL b1mul2 : signed(31 DOWNTO 0); -- sfix32_En30
|
146 | SIGNAL b2mul2 : signed(31 DOWNTO 0); -- sfix32_En30
|
147 | SIGNAL b3mul2 : signed(31 DOWNTO 0); -- sfix32_En30
|
148 | SIGNAL mul_temp_5 : signed(33 DOWNTO 0); -- sfix34_En31
|
149 | SIGNAL mul_temp_6 : signed(33 DOWNTO 0); -- sfix34_En31
|
150 | SIGNAL mul_temp_7 : signed(33 DOWNTO 0); -- sfix34_En30
|
151 | SIGNAL mul_temp_8 : signed(33 DOWNTO 0); -- sfix34_En30
|
152 | SIGNAL sub_cast_4 : signed(39 DOWNTO 0); -- sfix40_En29
|
153 | SIGNAL sub_cast_5 : signed(39 DOWNTO 0); -- sfix40_En29
|
154 | SIGNAL sub_temp_2 : signed(40 DOWNTO 0); -- sfix41_En29
|
155 | SIGNAL sub_cast_6 : signed(39 DOWNTO 0); -- sfix40_En29
|
156 | SIGNAL sub_cast_7 : signed(39 DOWNTO 0); -- sfix40_En29
|
157 | SIGNAL sub_temp_3 : signed(40 DOWNTO 0); -- sfix41_En29
|
158 | SIGNAL b1multypeconvert2 : signed(39 DOWNTO 0); -- sfix40_En30
|
159 | SIGNAL add_cast_4 : signed(39 DOWNTO 0); -- sfix40_En30
|
160 | SIGNAL add_cast_5 : signed(39 DOWNTO 0); -- sfix40_En30
|
161 | SIGNAL add_temp_2 : signed(40 DOWNTO 0); -- sfix41_En30
|
162 | SIGNAL add_cast_6 : signed(39 DOWNTO 0); -- sfix40_En30
|
163 | SIGNAL add_cast_7 : signed(39 DOWNTO 0); -- sfix40_En30
|
164 | SIGNAL add_temp_3 : signed(40 DOWNTO 0); -- sfix41_En30
|
165 | SIGNAL section_result2 : signed(39 DOWNTO 0); -- sfix40_En29
|
166 | -- Section 3 Signals
|
167 | SIGNAL a1sum3 : signed(39 DOWNTO 0); -- sfix40_En29
|
168 | SIGNAL a2sum3 : signed(39 DOWNTO 0); -- sfix40_En29
|
169 | SIGNAL b1sum3 : signed(39 DOWNTO 0); -- sfix40_En30
|
170 | SIGNAL b2sum3 : signed(39 DOWNTO 0); -- sfix40_En30
|
171 | SIGNAL typeconvert3 : signed(15 DOWNTO 0); -- sfix16_En15
|
172 | SIGNAL delay_section3 : delay_pipeline_type(0 TO 1); -- sfix16_En15
|
173 | SIGNAL inputconv3 : signed(39 DOWNTO 0); -- sfix40_En29
|
174 | SIGNAL a2mul3 : signed(31 DOWNTO 0); -- sfix32_En29
|
175 | SIGNAL a3mul3 : signed(31 DOWNTO 0); -- sfix32_En29
|
176 | SIGNAL b1mul3 : signed(31 DOWNTO 0); -- sfix32_En30
|
177 | SIGNAL b2mul3 : signed(31 DOWNTO 0); -- sfix32_En30
|
178 | SIGNAL b3mul3 : signed(31 DOWNTO 0); -- sfix32_En30
|
179 | SIGNAL mul_temp_9 : signed(33 DOWNTO 0); -- sfix34_En31
|
180 | SIGNAL mul_temp_10 : signed(33 DOWNTO 0); -- sfix34_En31
|
181 | SIGNAL mul_temp_11 : signed(33 DOWNTO 0); -- sfix34_En30
|
182 | SIGNAL mul_temp_12 : signed(33 DOWNTO 0); -- sfix34_En30
|
183 | SIGNAL sub_cast_8 : signed(39 DOWNTO 0); -- sfix40_En29
|
184 | SIGNAL sub_cast_9 : signed(39 DOWNTO 0); -- sfix40_En29
|
185 | SIGNAL sub_temp_4 : signed(40 DOWNTO 0); -- sfix41_En29
|
186 | SIGNAL sub_cast_10 : signed(39 DOWNTO 0); -- sfix40_En29
|
187 | SIGNAL sub_cast_11 : signed(39 DOWNTO 0); -- sfix40_En29
|
188 | SIGNAL sub_temp_5 : signed(40 DOWNTO 0); -- sfix41_En29
|
189 | SIGNAL b1multypeconvert3 : signed(39 DOWNTO 0); -- sfix40_En30
|
190 | SIGNAL add_cast_8 : signed(39 DOWNTO 0); -- sfix40_En30
|
191 | SIGNAL add_cast_9 : signed(39 DOWNTO 0); -- sfix40_En30
|
192 | SIGNAL add_temp_4 : signed(40 DOWNTO 0); -- sfix41_En30
|
193 | SIGNAL add_cast_10 : signed(39 DOWNTO 0); -- sfix40_En30
|
194 | SIGNAL add_cast_11 : signed(39 DOWNTO 0); -- sfix40_En30
|
195 | SIGNAL add_temp_5 : signed(40 DOWNTO 0); -- sfix41_En30
|
196 | SIGNAL section_result3 : signed(39 DOWNTO 0); -- sfix40_En29
|
197 | -- Section 4 Signals
|
198 | SIGNAL a1sum4 : signed(39 DOWNTO 0); -- sfix40_En29
|
199 | SIGNAL a2sum4 : signed(39 DOWNTO 0); -- sfix40_En29
|
200 | SIGNAL b1sum4 : signed(39 DOWNTO 0); -- sfix40_En30
|
201 | SIGNAL b2sum4 : signed(39 DOWNTO 0); -- sfix40_En30
|
202 | SIGNAL typeconvert4 : signed(15 DOWNTO 0); -- sfix16_En15
|
203 | SIGNAL delay_section4 : delay_pipeline_type(0 TO 1); -- sfix16_En15
|
204 | SIGNAL inputconv4 : signed(39 DOWNTO 0); -- sfix40_En29
|
205 | SIGNAL a2mul4 : signed(31 DOWNTO 0); -- sfix32_En29
|
206 | SIGNAL a3mul4 : signed(31 DOWNTO 0); -- sfix32_En29
|
207 | SIGNAL b1mul4 : signed(31 DOWNTO 0); -- sfix32_En30
|
208 | SIGNAL b2mul4 : signed(31 DOWNTO 0); -- sfix32_En30
|
209 | SIGNAL b3mul4 : signed(31 DOWNTO 0); -- sfix32_En30
|
210 | SIGNAL mul_temp_13 : signed(33 DOWNTO 0); -- sfix34_En31
|
211 | SIGNAL mul_temp_14 : signed(33 DOWNTO 0); -- sfix34_En31
|
212 | SIGNAL mul_temp_15 : signed(33 DOWNTO 0); -- sfix34_En30
|
213 | SIGNAL mul_temp_16 : signed(33 DOWNTO 0); -- sfix34_En30
|
214 | SIGNAL sub_cast_12 : signed(39 DOWNTO 0); -- sfix40_En29
|
215 | SIGNAL sub_cast_13 : signed(39 DOWNTO 0); -- sfix40_En29
|
216 | SIGNAL sub_temp_6 : signed(40 DOWNTO 0); -- sfix41_En29
|
217 | SIGNAL sub_cast_14 : signed(39 DOWNTO 0); -- sfix40_En29
|
218 | SIGNAL sub_cast_15 : signed(39 DOWNTO 0); -- sfix40_En29
|
219 | SIGNAL sub_temp_7 : signed(40 DOWNTO 0); -- sfix41_En29
|
220 | SIGNAL b1multypeconvert4 : signed(39 DOWNTO 0); -- sfix40_En30
|
221 | SIGNAL add_cast_12 : signed(39 DOWNTO 0); -- sfix40_En30
|
222 | SIGNAL add_cast_13 : signed(39 DOWNTO 0); -- sfix40_En30
|
223 | SIGNAL add_temp_6 : signed(40 DOWNTO 0); -- sfix41_En30
|
224 | SIGNAL add_cast_14 : signed(39 DOWNTO 0); -- sfix40_En30
|
225 | SIGNAL add_cast_15 : signed(39 DOWNTO 0); -- sfix40_En30
|
226 | SIGNAL add_temp_7 : signed(40 DOWNTO 0); -- sfix41_En30
|
227 | SIGNAL output_typeconvert : signed(31 DOWNTO 0); -- sfix32_En26
|
228 | SIGNAL output_register : signed(31 DOWNTO 0); -- sfix32_En26
|
229 |
|
230 |
|
231 | BEGIN
|
232 |
|
233 | -- Block Statements
|
234 | input_reg_process : PROCESS (clk, reset)
|
235 | BEGIN
|
236 | IF reset = '1' THEN
|
237 | input_register <= (OTHERS => '0');
|
238 | ELSIF clk'event AND clk = '1' THEN
|
239 | IF clk_enable = '1' THEN
|
240 | input_register <= signed(filter_in);
|
241 | END IF;
|
242 | END IF;
|
243 | END PROCESS input_reg_process;
|
244 |
|
245 | mul_temp <= input_register * scaleconst1;
|
246 | scale1 <= resize(mul_temp, 55);
|
247 |
|
248 | scaletypeconvert1 <= resize(shift_right(scale1(54 DOWNTO 0) + ( "0" & (scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37) & NOT scale1(37))), 37), 18);
|
249 |
|
250 | -- ------------------ Section 1 ------------------
|
251 |
|
252 | typeconvert1 <= resize(shift_right(a1sum1(29 DOWNTO 0) + ( "0" & (a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14) & NOT a1sum1(14))), 14), 16);
|
253 |
|
254 | delay_process_section1 : PROCESS (clk, reset)
|
255 | BEGIN
|
256 | IF reset = '1' THEN
|
257 | delay_section1 <= (OTHERS => (OTHERS => '0'));
|
258 | ELSIF clk'event AND clk = '1' THEN
|
259 | IF clk_enable = '1' THEN
|
260 | delay_section1(1) <= delay_section1(0);
|
261 | delay_section1(0) <= typeconvert1;
|
262 | END IF;
|
263 | END IF;
|
264 | END PROCESS delay_process_section1;
|
265 |
|
266 | inputconv1 <= resize(shift_right(scaletypeconvert1(17) & scaletypeconvert1(17 DOWNTO 0) + ( "0" & (scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11) & NOT scaletypeconvert1(11))), 11), 40);
|
267 |
|
268 | mul_temp_1 <= delay_section1(0) * coeff_a2_section1;
|
269 | a2mul1 <= resize(shift_right(mul_temp_1(33 DOWNTO 0) + ( "0" & (mul_temp_1(2) & NOT mul_temp_1(2))), 2), 32);
|
270 |
|
271 | mul_temp_2 <= delay_section1(1) * coeff_a3_section1;
|
272 | a3mul1 <= resize(shift_right(mul_temp_2(33 DOWNTO 0) + ( "0" & (mul_temp_2(2) & NOT mul_temp_2(2))), 2), 32);
|
273 |
|
274 | b1mul1 <= resize(typeconvert1(15 DOWNTO 0) & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 32);
|
275 |
|
276 | mul_temp_3 <= delay_section1(0) * coeff_b2_section1;
|
277 | b2mul1 <= mul_temp_3(31 DOWNTO 0);
|
278 |
|
279 | mul_temp_4 <= delay_section1(1) * coeff_b3_section1;
|
280 | b3mul1 <= mul_temp_4(31 DOWNTO 0);
|
281 |
|
282 | sub_cast <= inputconv1;
|
283 | sub_cast_1 <= resize(a2mul1, 40);
|
284 | sub_temp <= resize(sub_cast, 41) - resize(sub_cast_1, 41);
|
285 | a2sum1 <= sub_temp(39 DOWNTO 0);
|
286 |
|
287 | sub_cast_2 <= a2sum1;
|
288 | sub_cast_3 <= resize(a3mul1, 40);
|
289 | sub_temp_1 <= resize(sub_cast_2, 41) - resize(sub_cast_3, 41);
|
290 | a1sum1 <= sub_temp_1(39 DOWNTO 0);
|
291 |
|
292 | b1multypeconvert1 <= resize(b1mul1, 40);
|
293 |
|
294 | add_cast <= b1multypeconvert1;
|
295 | add_cast_1 <= resize(b2mul1, 40);
|
296 | add_temp <= resize(add_cast, 41) + resize(add_cast_1, 41);
|
297 | b2sum1 <= add_temp(39 DOWNTO 0);
|
298 |
|
299 | add_cast_2 <= b2sum1;
|
300 | add_cast_3 <= resize(b3mul1, 40);
|
301 | add_temp_1 <= resize(add_cast_2, 41) + resize(add_cast_3, 41);
|
302 | b1sum1 <= add_temp_1(39 DOWNTO 0);
|
303 |
|
304 | section_result1 <= resize(shift_right(b1sum1(39) & b1sum1(39 DOWNTO 0) + ( "0" & (b1sum1(1))), 1), 40);
|
305 |
|
306 | -- ------------------ Section 2 ------------------
|
307 |
|
308 | typeconvert2 <= resize(shift_right(a1sum2(29 DOWNTO 0) + ( "0" & (a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14) & NOT a1sum2(14))), 14), 16);
|
309 |
|
310 | delay_process_section2 : PROCESS (clk, reset)
|
311 | BEGIN
|
312 | IF reset = '1' THEN
|
313 | delay_section2 <= (OTHERS => (OTHERS => '0'));
|
314 | ELSIF clk'event AND clk = '1' THEN
|
315 | IF clk_enable = '1' THEN
|
316 | delay_section2(1) <= delay_section2(0);
|
317 | delay_section2(0) <= typeconvert2;
|
318 | END IF;
|
319 | END IF;
|
320 | END PROCESS delay_process_section2;
|
321 |
|
322 | inputconv2 <= section_result1;
|
323 |
|
324 | mul_temp_5 <= delay_section2(0) * coeff_a2_section2;
|
325 | a2mul2 <= resize(shift_right(mul_temp_5(33 DOWNTO 0) + ( "0" & (mul_temp_5(2) & NOT mul_temp_5(2))), 2), 32);
|
326 |
|
327 | mul_temp_6 <= delay_section2(1) * coeff_a3_section2;
|
328 | a3mul2 <= resize(shift_right(mul_temp_6(33 DOWNTO 0) + ( "0" & (mul_temp_6(2) & NOT mul_temp_6(2))), 2), 32);
|
329 |
|
330 | b1mul2 <= resize(typeconvert2(15 DOWNTO 0) & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 32);
|
331 |
|
332 | mul_temp_7 <= delay_section2(0) * coeff_b2_section2;
|
333 | b2mul2 <= mul_temp_7(31 DOWNTO 0);
|
334 |
|
335 | mul_temp_8 <= delay_section2(1) * coeff_b3_section2;
|
336 | b3mul2 <= mul_temp_8(31 DOWNTO 0);
|
337 |
|
338 | sub_cast_4 <= inputconv2;
|
339 | sub_cast_5 <= resize(a2mul2, 40);
|
340 | sub_temp_2 <= resize(sub_cast_4, 41) - resize(sub_cast_5, 41);
|
341 | a2sum2 <= sub_temp_2(39 DOWNTO 0);
|
342 |
|
343 | sub_cast_6 <= a2sum2;
|
344 | sub_cast_7 <= resize(a3mul2, 40);
|
345 | sub_temp_3 <= resize(sub_cast_6, 41) - resize(sub_cast_7, 41);
|
346 | a1sum2 <= sub_temp_3(39 DOWNTO 0);
|
347 |
|
348 | b1multypeconvert2 <= resize(b1mul2, 40);
|
349 |
|
350 | add_cast_4 <= b1multypeconvert2;
|
351 | add_cast_5 <= resize(b2mul2, 40);
|
352 | add_temp_2 <= resize(add_cast_4, 41) + resize(add_cast_5, 41);
|
353 | b2sum2 <= add_temp_2(39 DOWNTO 0);
|
354 |
|
355 | add_cast_6 <= b2sum2;
|
356 | add_cast_7 <= resize(b3mul2, 40);
|
357 | add_temp_3 <= resize(add_cast_6, 41) + resize(add_cast_7, 41);
|
358 | b1sum2 <= add_temp_3(39 DOWNTO 0);
|
359 |
|
360 | section_result2 <= resize(shift_right(b1sum2(39) & b1sum2(39 DOWNTO 0) + ( "0" & (b1sum2(1))), 1), 40);
|
361 |
|
362 | -- ------------------ Section 3 ------------------
|
363 |
|
364 | typeconvert3 <= resize(shift_right(a1sum3(29 DOWNTO 0) + ( "0" & (a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14) & NOT a1sum3(14))), 14), 16);
|
365 |
|
366 | delay_process_section3 : PROCESS (clk, reset)
|
367 | BEGIN
|
368 | IF reset = '1' THEN
|
369 | delay_section3 <= (OTHERS => (OTHERS => '0'));
|
370 | ELSIF clk'event AND clk = '1' THEN
|
371 | IF clk_enable = '1' THEN
|
372 | delay_section3(1) <= delay_section3(0);
|
373 | delay_section3(0) <= typeconvert3;
|
374 | END IF;
|
375 | END IF;
|
376 | END PROCESS delay_process_section3;
|
377 |
|
378 | inputconv3 <= section_result2;
|
379 |
|
380 | mul_temp_9 <= delay_section3(0) * coeff_a2_section3;
|
381 | a2mul3 <= resize(shift_right(mul_temp_9(33 DOWNTO 0) + ( "0" & (mul_temp_9(2) & NOT mul_temp_9(2))), 2), 32);
|
382 |
|
383 | mul_temp_10 <= delay_section3(1) * coeff_a3_section3;
|
384 | a3mul3 <= resize(shift_right(mul_temp_10(33 DOWNTO 0) + ( "0" & (mul_temp_10(2) & NOT mul_temp_10(2))), 2), 32);
|
385 |
|
386 | b1mul3 <= resize(typeconvert3(15 DOWNTO 0) & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 32);
|
387 |
|
388 | mul_temp_11 <= delay_section3(0) * coeff_b2_section3;
|
389 | b2mul3 <= mul_temp_11(31 DOWNTO 0);
|
390 |
|
391 | mul_temp_12 <= delay_section3(1) * coeff_b3_section3;
|
392 | b3mul3 <= mul_temp_12(31 DOWNTO 0);
|
393 |
|
394 | sub_cast_8 <= inputconv3;
|
395 | sub_cast_9 <= resize(a2mul3, 40);
|
396 | sub_temp_4 <= resize(sub_cast_8, 41) - resize(sub_cast_9, 41);
|
397 | a2sum3 <= sub_temp_4(39 DOWNTO 0);
|
398 |
|
399 | sub_cast_10 <= a2sum3;
|
400 | sub_cast_11 <= resize(a3mul3, 40);
|
401 | sub_temp_5 <= resize(sub_cast_10, 41) - resize(sub_cast_11, 41);
|
402 | a1sum3 <= sub_temp_5(39 DOWNTO 0);
|
403 |
|
404 | b1multypeconvert3 <= resize(b1mul3, 40);
|
405 |
|
406 | add_cast_8 <= b1multypeconvert3;
|
407 | add_cast_9 <= resize(b2mul3, 40);
|
408 | add_temp_4 <= resize(add_cast_8, 41) + resize(add_cast_9, 41);
|
409 | b2sum3 <= add_temp_4(39 DOWNTO 0);
|
410 |
|
411 | add_cast_10 <= b2sum3;
|
412 | add_cast_11 <= resize(b3mul3, 40);
|
413 | add_temp_5 <= resize(add_cast_10, 41) + resize(add_cast_11, 41);
|
414 | b1sum3 <= add_temp_5(39 DOWNTO 0);
|
415 |
|
416 | section_result3 <= resize(shift_right(b1sum3(39) & b1sum3(39 DOWNTO 0) + ( "0" & (b1sum3(1))), 1), 40);
|
417 |
|
418 | -- ------------------ Section 4 ------------------
|
419 |
|
420 | typeconvert4 <= resize(shift_right(a1sum4(29 DOWNTO 0) + ( "0" & (a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14) & NOT a1sum4(14))), 14), 16);
|
421 |
|
422 | delay_process_section4 : PROCESS (clk, reset)
|
423 | BEGIN
|
424 | IF reset = '1' THEN
|
425 | delay_section4 <= (OTHERS => (OTHERS => '0'));
|
426 | ELSIF clk'event AND clk = '1' THEN
|
427 | IF clk_enable = '1' THEN
|
428 | delay_section4(1) <= delay_section4(0);
|
429 | delay_section4(0) <= typeconvert4;
|
430 | END IF;
|
431 | END IF;
|
432 | END PROCESS delay_process_section4;
|
433 |
|
434 | inputconv4 <= section_result3;
|
435 |
|
436 | mul_temp_13 <= delay_section4(0) * coeff_a2_section4;
|
437 | a2mul4 <= resize(shift_right(mul_temp_13(33 DOWNTO 0) + ( "0" & (mul_temp_13(2) & NOT mul_temp_13(2))), 2), 32);
|
438 |
|
439 | mul_temp_14 <= delay_section4(1) * coeff_a3_section4;
|
440 | a3mul4 <= resize(shift_right(mul_temp_14(33 DOWNTO 0) + ( "0" & (mul_temp_14(2) & NOT mul_temp_14(2))), 2), 32);
|
441 |
|
442 | b1mul4 <= resize(typeconvert4(15 DOWNTO 0) & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 32);
|
443 |
|
444 | mul_temp_15 <= delay_section4(0) * coeff_b2_section4;
|
445 | b2mul4 <= mul_temp_15(31 DOWNTO 0);
|
446 |
|
447 | mul_temp_16 <= delay_section4(1) * coeff_b3_section4;
|
448 | b3mul4 <= mul_temp_16(31 DOWNTO 0);
|
449 |
|
450 | sub_cast_12 <= inputconv4;
|
451 | sub_cast_13 <= resize(a2mul4, 40);
|
452 | sub_temp_6 <= resize(sub_cast_12, 41) - resize(sub_cast_13, 41);
|
453 | a2sum4 <= sub_temp_6(39 DOWNTO 0);
|
454 |
|
455 | sub_cast_14 <= a2sum4;
|
456 | sub_cast_15 <= resize(a3mul4, 40);
|
457 | sub_temp_7 <= resize(sub_cast_14, 41) - resize(sub_cast_15, 41);
|
458 | a1sum4 <= sub_temp_7(39 DOWNTO 0);
|
459 |
|
460 | b1multypeconvert4 <= resize(b1mul4, 40);
|
461 |
|
462 | add_cast_12 <= b1multypeconvert4;
|
463 | add_cast_13 <= resize(b2mul4, 40);
|
464 | add_temp_6 <= resize(add_cast_12, 41) + resize(add_cast_13, 41);
|
465 | b2sum4 <= add_temp_6(39 DOWNTO 0);
|
466 |
|
467 | add_cast_14 <= b2sum4;
|
468 | add_cast_15 <= resize(b3mul4, 40);
|
469 | add_temp_7 <= resize(add_cast_14, 41) + resize(add_cast_15, 41);
|
470 | b1sum4 <= add_temp_7(39 DOWNTO 0);
|
471 |
|
472 | output_typeconvert <= resize(shift_right(b1sum4(35 DOWNTO 0) + ( "0" & (b1sum4(4) & NOT b1sum4(4) & NOT b1sum4(4) & NOT b1sum4(4))), 4), 32);
|
473 |
|
474 | Output_Register_process : PROCESS (clk, reset)
|
475 | BEGIN
|
476 | IF reset = '1' THEN
|
477 | output_register <= (OTHERS => '0');
|
478 | ELSIF clk'event AND clk = '1' THEN
|
479 | IF clk_enable = '1' THEN
|
480 | output_register <= output_typeconvert;
|
481 | END IF;
|
482 | END IF;
|
483 | END PROCESS Output_Register_process;
|
484 |
|
485 | -- Assignment Statements
|
486 | filter_out <= std_logic_vector(output_register);
|
487 | END rtl;
|