-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirst_stage.vhd
More file actions
145 lines (116 loc) · 4.37 KB
/
first_stage.vhd
File metadata and controls
145 lines (116 loc) · 4.37 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
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.user_pkg.all;
entity first_stage is
generic (
width : positive := DATA_WIDTH);
port (
clk : in std_logic;
rst : in std_logic;
en : in std_logic;
input_valid : in std_logic;
output_valid : out std_logic;
r0_input, r1_input, r2_input, r3_input : in std_logic_vector(width - 1 downto 0);
i0_input, i1_input, i2_input, i3_input : in std_logic_vector(width - 1 downto 0);
r0_output, r1_output, r2_output, r3_output : out std_logic_vector(width - 1 downto 0);
i0_output, i1_output, i2_output, i3_output : out std_logic_vector(width - 1 downto 0));
end first_stage;
architecture STR of first_stage is
signal b_0_0_out_0_real, b_0_0_out_0_img, b_0_0_out_1_real, b_0_0_out_1_img : std_logic_vector(width - 1 downto 0);
signal b_0_0_db_out_0_real, b_0_0_db_out_0_img : std_logic_vector(width - 1 downto 0);
signal b_0_0_db_out_1_real, b_0_0_db_out_1_img : std_logic_vector(width - 1 downto 0);
signal b_0_1_out_0_real, b_0_1_out_0_img, b_0_1_out_1_real, b_0_1_out_1_img : std_logic_vector(width - 1 downto 0);
signal b_0_1_tm_out_1_real_2x, b_0_1_tm_out_1_img_2x : std_logic_vector((width * 2) - 1 downto 0);
alias b_0_1_tm_out_1_real is b_0_1_tm_out_1_real_2x((width * 2) - 2 downto width - 1);
alias b_0_1_tm_out_1_img is b_0_1_tm_out_1_img_2x((width * 2) - 2 downto width - 1);
begin
b_0_0 : entity work.butterfly(STR)
generic map(
width => width)
port map(
clk => clk,
rst => rst,
en => en,
input_0_real => r0_input,
input_0_img => i0_input,
input_1_real => r1_input,
input_1_img => i1_input,
output_0_real => b_0_0_out_0_real,
output_0_img => b_0_0_out_0_img,
output_1_real => b_0_0_out_1_real,
output_1_img => b_0_0_out_1_img);
b_0_1 : entity work.butterfly(STR)
generic map(
width => width)
port map(
clk => clk,
rst => rst,
en => en,
input_0_real => r2_input,
input_0_img => i2_input,
input_1_real => r3_input,
input_1_img => i3_input,
output_0_real => b_0_1_out_0_real,
output_0_img => b_0_1_out_0_img,
output_1_real => b_0_1_out_1_real,
output_1_img => b_0_1_out_1_img);
tm_0 : entity work.complex_mult(BHV_PIPELINED)
generic map(width => width)
port map(
clk => clk,
rst => rst,
en => en,
dataa_real => b_0_1_out_1_real,
dataa_imag => b_0_1_out_1_img,
datab_real => ZERO,
datab_imag => NEGATIVE_ONE,
result_real => b_0_1_tm_out_1_real_2x,
result_imag => b_0_1_tm_out_1_img_2x);
r3_output <= b_0_1_tm_out_1_real;
i3_output <= b_0_1_tm_out_1_img;
db_0 : entity work.pipe_reg
generic map(
length => 3,
width => width)
port map(
clk => clk,
rst => rst,
en => en,
input_real => b_0_0_out_0_real,
input_img => b_0_0_out_0_img,
output_real => r0_output,
output_img => i0_output);
db_1 : entity work.pipe_reg
generic map(
length => 3,
width => width)
port map(
clk => clk,
rst => rst,
en => en,
input_real => b_0_0_out_1_real,
input_img => b_0_0_out_1_img,
output_real => r2_output,
output_img => i2_output);
db_2 : entity work.pipe_reg
generic map(
length => 3,
width => width)
port map(
clk => clk,
rst => rst,
en => en,
input_real => b_0_1_out_0_real,
input_img => b_0_1_out_0_img,
output_real => r1_output,
output_img => i1_output);
stage_delay : entity work.delay
generic map(width => 1, length => 4)
port map(
clk => clk,
rst => rst,
en => en,
input(0) => input_valid,
output(0) => output_valid);
end STR;