1 |
7 |
dbrochart |
----------------------------------------------------------------------
|
2 |
|
|
---- ----
|
3 |
|
|
---- iteration_synth.vhd ----
|
4 |
|
|
---- ----
|
5 |
|
|
---- This file is part of the turbo decoder IP core project ----
|
6 |
|
|
---- http://www.opencores.org/projects/turbocodes/ ----
|
7 |
|
|
---- ----
|
8 |
|
|
---- Author(s): ----
|
9 |
|
|
---- - David Brochart(dbrochart@opencores.org) ----
|
10 |
|
|
---- ----
|
11 |
|
|
---- All additional information is available in the README.txt ----
|
12 |
|
|
---- file. ----
|
13 |
|
|
---- ----
|
14 |
|
|
----------------------------------------------------------------------
|
15 |
|
|
---- ----
|
16 |
|
|
---- Copyright (C) 2005 Authors ----
|
17 |
|
|
---- ----
|
18 |
|
|
---- This source file may be used and distributed without ----
|
19 |
|
|
---- restriction provided that this copyright statement is not ----
|
20 |
|
|
---- removed from the file and that any derivative work contains ----
|
21 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
22 |
|
|
---- ----
|
23 |
|
|
---- This source file is free software; you can redistribute it ----
|
24 |
|
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
25 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
26 |
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
27 |
|
|
---- later version. ----
|
28 |
|
|
---- ----
|
29 |
|
|
---- This source is distributed in the hope that it will be ----
|
30 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
31 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
32 |
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
33 |
|
|
---- details. ----
|
34 |
|
|
---- ----
|
35 |
|
|
---- You should have received a copy of the GNU Lesser General ----
|
36 |
|
|
---- Public License along with this source; if not, download it ----
|
37 |
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
38 |
|
|
---- ----
|
39 |
|
|
----------------------------------------------------------------------
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
architecture synth of iteration is
|
44 |
|
|
signal zout1 : ARRAY4c;
|
45 |
|
|
signal zout2 : ARRAY4c;
|
46 |
|
|
signal zout1Perm : ARRAY4c;
|
47 |
|
|
signal zoutInt1 : ARRAY4c;
|
48 |
|
|
signal zout2Int : ARRAY4c;
|
49 |
|
|
signal tmp0 : std_logic_vector(Z_WIDTH * 4 + SIG_WIDTH * 2 - 1 downto 0);
|
50 |
|
|
signal tmp1 : std_logic_vector(Z_WIDTH * 4 + SIG_WIDTH * 2 - 1 downto 0);
|
51 |
|
|
signal tmp2 : std_logic_vector(SIG_WIDTH * 6 - 1 downto 0);
|
52 |
|
|
signal tmp3 : std_logic_vector(SIG_WIDTH * 6 - 1 downto 0);
|
53 |
|
|
signal tmp4 : std_logic_vector(SIG_WIDTH * 4 - 1 downto 0);
|
54 |
|
|
signal tmp5 : std_logic_vector(SIG_WIDTH * 4 - 1 downto 0);
|
55 |
|
|
signal tmp6 : std_logic_vector(Z_WIDTH * 4 - 1 downto 0);
|
56 |
|
|
signal tmp7 : std_logic_vector(Z_WIDTH * 4 - 1 downto 0);
|
57 |
|
|
signal tmp8 : std_logic_vector(SIG_WIDTH * 6 - 1 downto 0);
|
58 |
|
|
signal tmp9 : std_logic_vector(SIG_WIDTH * 6 - 1 downto 0);
|
59 |
|
|
signal tmp10 : std_logic_vector(SIG_WIDTH * 8 - 1 downto 0);
|
60 |
|
|
signal tmp11 : std_logic_vector(SIG_WIDTH * 8 - 1 downto 0);
|
61 |
|
|
signal abDel1Perm : ARRAY2a;
|
62 |
|
|
signal abDel1PermInt: ARRAY2a;
|
63 |
|
|
signal aDel1 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
64 |
|
|
signal bDel1 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
65 |
|
|
signal yDel1 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
66 |
|
|
signal wDel1 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
67 |
|
|
signal yIntDel1 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
68 |
|
|
signal wIntDel1 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
69 |
|
|
signal aDel2 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
70 |
|
|
signal bDel2 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
71 |
|
|
signal yDel2 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
72 |
|
|
signal wDel2 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
73 |
|
|
signal aDecInt : std_logic;
|
74 |
|
|
signal bDecInt : std_logic;
|
75 |
|
|
signal aDel3 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
76 |
|
|
signal bDel3 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
77 |
|
|
signal yDel3 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
78 |
|
|
signal wDel3 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
79 |
|
|
signal yIntDel3 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
80 |
|
|
signal wIntDel3 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
81 |
|
|
signal yIntDel4 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
82 |
|
|
signal wIntDel4 : std_logic_vector(SIG_WIDTH - 1 downto 0);
|
83 |
|
|
begin
|
84 |
|
|
sova_i0 : sova port map (
|
85 |
|
|
clk => clk,
|
86 |
|
|
rst => rst,
|
87 |
|
|
aNoisy => a,
|
88 |
|
|
bNoisy => b,
|
89 |
|
|
yNoisy => y,
|
90 |
|
|
wNoisy => w,
|
91 |
|
|
zin => zin,
|
92 |
|
|
zout => zout1,
|
93 |
|
|
aClean => aDec,
|
94 |
|
|
bClean => bDec
|
95 |
|
|
);
|
96 |
|
|
zPermut_i0 : zPermut generic map (
|
97 |
|
|
flip => (TREL1_LEN + TREL2_LEN + 2 + delay + 1) mod 2
|
98 |
|
|
)
|
99 |
|
|
port map (
|
100 |
|
|
flipflop => flipflop,
|
101 |
|
|
z => zout1,
|
102 |
|
|
zPerm => zout1Perm
|
103 |
|
|
);
|
104 |
|
|
|
105 |
|
|
tmp0 <= zout1Perm(0) & zout1Perm(1) & zout1Perm(2) & zout1Perm(3) & abDel1Perm(0) & abDel1Perm(1);
|
106 |
|
|
|
107 |
|
|
interleaver_i0 : interleaver generic map (
|
108 |
|
|
delay => TREL1_LEN + TREL2_LEN + 2 + delay,
|
109 |
|
|
way => 0
|
110 |
|
|
)
|
111 |
|
|
port map (
|
112 |
|
|
clk => clk,
|
113 |
|
|
rst => rst,
|
114 |
|
|
d => tmp0,
|
115 |
|
|
q => tmp1
|
116 |
|
|
);
|
117 |
|
|
|
118 |
|
|
zoutInt1(0) <= tmp1(Z_WIDTH * 4 + SIG_WIDTH * 2 - 1 downto Z_WIDTH * 3 + SIG_WIDTH * 2);
|
119 |
|
|
zoutInt1(1) <= tmp1(Z_WIDTH * 3 + SIG_WIDTH * 2 - 1 downto Z_WIDTH * 2 + SIG_WIDTH * 2);
|
120 |
|
|
zoutInt1(2) <= tmp1(Z_WIDTH * 2 + SIG_WIDTH * 2 - 1 downto Z_WIDTH * 1 + SIG_WIDTH * 2);
|
121 |
|
|
zoutInt1(3) <= tmp1(Z_WIDTH * 1 + SIG_WIDTH * 2 - 1 downto Z_WIDTH * 0 + SIG_WIDTH * 2);
|
122 |
|
|
abDel1PermInt(0) <= tmp1(SIG_WIDTH * 2 - 1 downto SIG_WIDTH * 1);
|
123 |
|
|
abDel1PermInt(1) <= tmp1(SIG_WIDTH * 1 - 1 downto SIG_WIDTH * 0);
|
124 |
|
|
|
125 |
|
|
tmp2 <= a & b & y & w & yInt & wInt;
|
126 |
|
|
|
127 |
|
|
delayer_i0 : delayer generic map (
|
128 |
|
|
delay => TREL1_LEN + TREL2_LEN
|
129 |
|
|
)
|
130 |
|
|
port map (
|
131 |
|
|
clk => clk,
|
132 |
|
|
rst => rst,
|
133 |
|
|
d => tmp2,
|
134 |
|
|
q => tmp3
|
135 |
|
|
);
|
136 |
|
|
|
137 |
|
|
aDel1 <= tmp3(SIG_WIDTH * 6 - 1 downto SIG_WIDTH * 5);
|
138 |
|
|
bDel1 <= tmp3(SIG_WIDTH * 5 - 1 downto SIG_WIDTH * 4);
|
139 |
|
|
yDel1 <= tmp3(SIG_WIDTH * 4 - 1 downto SIG_WIDTH * 3);
|
140 |
|
|
wDel1 <= tmp3(SIG_WIDTH * 3 - 1 downto SIG_WIDTH * 2);
|
141 |
|
|
yIntDel1 <= tmp3(SIG_WIDTH * 2 - 1 downto SIG_WIDTH * 1);
|
142 |
|
|
wIntDel1 <= tmp3(SIG_WIDTH * 1 - 1 downto SIG_WIDTH * 0);
|
143 |
|
|
|
144 |
|
|
abPermut_i0 : abPermut generic map (
|
145 |
|
|
flip => (TREL1_LEN + TREL2_LEN + 2 + delay + 1) mod 2
|
146 |
|
|
)
|
147 |
|
|
port map (
|
148 |
|
|
flipflop => flipflop,
|
149 |
|
|
a => aDel1,
|
150 |
|
|
b => bDel1,
|
151 |
|
|
abPerm => abDel1Perm
|
152 |
|
|
);
|
153 |
|
|
|
154 |
|
|
tmp4 <= aDel1 & bDel1 & yDel1 & wDel1;
|
155 |
|
|
|
156 |
|
|
delayer_i1 : delayer generic map (
|
157 |
|
|
delay => FRSIZE
|
158 |
|
|
)
|
159 |
|
|
port map (
|
160 |
|
|
clk => clk,
|
161 |
|
|
rst => rst,
|
162 |
|
|
d => tmp4,
|
163 |
|
|
q => tmp5
|
164 |
|
|
);
|
165 |
|
|
|
166 |
|
|
aDel2 <= tmp5(SIG_WIDTH * 4 - 1 downto SIG_WIDTH * 3);
|
167 |
|
|
bDel2 <= tmp5(SIG_WIDTH * 3 - 1 downto SIG_WIDTH * 2);
|
168 |
|
|
yDel2 <= tmp5(SIG_WIDTH * 2 - 1 downto SIG_WIDTH * 1);
|
169 |
|
|
wDel2 <= tmp5(SIG_WIDTH * 1 - 1 downto SIG_WIDTH * 0);
|
170 |
|
|
|
171 |
|
|
sova_i1 : sova port map (
|
172 |
|
|
clk => clk,
|
173 |
|
|
rst => rst,
|
174 |
|
|
aNoisy => abDel1PermInt(1),
|
175 |
|
|
bNoisy => abDel1PermInt(0),
|
176 |
|
|
yNoisy => yIntDel1,
|
177 |
|
|
wNoisy => wIntDel1,
|
178 |
|
|
zin => zoutInt1,
|
179 |
|
|
zout => zout2,
|
180 |
|
|
aClean => aDecInt,
|
181 |
|
|
bClean => bDecInt
|
182 |
|
|
);
|
183 |
|
|
|
184 |
|
|
tmp6 <= zout2(0) & zout2(1) & zout2(2) & zout2(3);
|
185 |
|
|
|
186 |
|
|
deinterleaver_i0 : interleaver generic map (
|
187 |
|
|
delay => 2 * (TREL1_LEN + TREL2_LEN + 2) + FRSIZE + delay,
|
188 |
|
|
way => 1
|
189 |
|
|
)
|
190 |
|
|
port map (
|
191 |
|
|
clk => clk,
|
192 |
|
|
rst => rst,
|
193 |
|
|
d => tmp6,
|
194 |
|
|
q => tmp7
|
195 |
|
|
);
|
196 |
|
|
|
197 |
|
|
zout2Int(0) <= tmp7(Z_WIDTH * 4 - 1 downto Z_WIDTH * 3);
|
198 |
|
|
zout2Int(1) <= tmp7(Z_WIDTH * 3 - 1 downto Z_WIDTH * 2);
|
199 |
|
|
zout2Int(2) <= tmp7(Z_WIDTH * 2 - 1 downto Z_WIDTH * 1);
|
200 |
|
|
zout2Int(3) <= tmp7(Z_WIDTH * 1 - 1 downto Z_WIDTH * 0);
|
201 |
|
|
|
202 |
|
|
zPermut_i1 : zPermut generic map (
|
203 |
|
|
flip => (2 * (TREL1_LEN + TREL2_LEN + 2) + FRSIZE + delay) mod 2
|
204 |
|
|
)
|
205 |
|
|
port map (
|
206 |
|
|
flipflop => flipflop,
|
207 |
|
|
z => zout2Int,
|
208 |
|
|
zPerm => zout
|
209 |
|
|
);
|
210 |
|
|
|
211 |
|
|
tmp8 <= aDel2 & bDel2 & yDel2 & wDel2 & yIntDel1 & wIntDel1;
|
212 |
|
|
|
213 |
|
|
delayer_i2 : delayer generic map (
|
214 |
|
|
delay => TREL1_LEN + TREL2_LEN
|
215 |
|
|
)
|
216 |
|
|
port map (
|
217 |
|
|
clk => clk,
|
218 |
|
|
rst => rst,
|
219 |
|
|
d => tmp8,
|
220 |
|
|
q => tmp9
|
221 |
|
|
);
|
222 |
|
|
|
223 |
|
|
aDel3 <= tmp9(SIG_WIDTH * 6 - 1 downto SIG_WIDTH * 5);
|
224 |
|
|
bDel3 <= tmp9(SIG_WIDTH * 5 - 1 downto SIG_WIDTH * 4);
|
225 |
|
|
yDel3 <= tmp9(SIG_WIDTH * 4 - 1 downto SIG_WIDTH * 3);
|
226 |
|
|
wDel3 <= tmp9(SIG_WIDTH * 3 - 1 downto SIG_WIDTH * 2);
|
227 |
|
|
yIntDel3 <= tmp9(SIG_WIDTH * 2 - 1 downto SIG_WIDTH * 1);
|
228 |
|
|
wIntDel3 <= tmp9(SIG_WIDTH * 1 - 1 downto SIG_WIDTH * 0);
|
229 |
|
|
|
230 |
|
|
tmp10 <= aDel3 & bDel3 & yDel3 & wDel3 & yIntDel3 & wIntDel3 & yIntDel4 & wIntDel4;
|
231 |
|
|
|
232 |
|
|
delayer_i3 : delayer generic map (
|
233 |
|
|
delay => FRSIZE
|
234 |
|
|
)
|
235 |
|
|
port map (
|
236 |
|
|
clk => clk,
|
237 |
|
|
rst => rst,
|
238 |
|
|
d => tmp10,
|
239 |
|
|
q => tmp11
|
240 |
|
|
);
|
241 |
|
|
|
242 |
|
|
aDel <= tmp11(SIG_WIDTH * 8 - 1 downto SIG_WIDTH * 7);
|
243 |
|
|
bDel <= tmp11(SIG_WIDTH * 7 - 1 downto SIG_WIDTH * 6);
|
244 |
|
|
yDel <= tmp11(SIG_WIDTH * 6 - 1 downto SIG_WIDTH * 5);
|
245 |
|
|
wDel <= tmp11(SIG_WIDTH * 5 - 1 downto SIG_WIDTH * 4);
|
246 |
|
|
yIntDel4 <= tmp11(SIG_WIDTH * 4 - 1 downto SIG_WIDTH * 3);
|
247 |
|
|
wIntDel4 <= tmp11(SIG_WIDTH * 3 - 1 downto SIG_WIDTH * 2);
|
248 |
|
|
yIntDel <= tmp11(SIG_WIDTH * 2 - 1 downto SIG_WIDTH * 1);
|
249 |
|
|
wIntDel <= tmp11(SIG_WIDTH * 1 - 1 downto SIG_WIDTH * 0);
|
250 |
|
|
|
251 |
|
|
end;
|