-
Notifications
You must be signed in to change notification settings - Fork 0
/
DAV.v
87 lines (77 loc) · 1.57 KB
/
DAV.v
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
module DAV
#(parameter ADDR_WIDTH = 9, parameter DATA_WIDTH = 22, parameter MIC_BITS = 18)
(
input clk, rst, DOUT,
output BCLK, LRCLK,
output [3:0] VGA_R, VGA_G, VGA_B,
output VGA_HS, VGA_VS
);
wire clk_50M = clk;
wire clk_2M5, clk_25M;
wire start, mic_we;
wire [(ADDR_WIDTH-1):0] mic_addr;
wire [(MIC_BITS-1):0] mic_data;
wire [(ADDR_WIDTH-2):0] vga_addr;
wire [(DATA_WIDTH-1):0] vga_data_r, vga_data_i;
wire done;
clkdiv
#(.THRESHOLD(0))
generate_clk_25M
(
.clk_in(clk_50M),
.clk_out(clk_25M)
);
clkdiv
#(.THRESHOLD(9))
generate_clk_2M5
(
.clk_in(clk_50M),
.clk_out(clk_2M5)
);
mic_translator
#(.ADDR_WIDTH(ADDR_WIDTH), .MIC_BITS(MIC_BITS))
mic
(
.clk(clk_2M5),
.rst(rst),
.BCLK(BCLK),
.DOUT(DOUT),
.LRCLK(LRCLK),
.mic_we(mic_we),
.mic_addr(mic_addr),
.mic_data(mic_data),
.start(start)
);
FFT_processor
#(.ADDR_WIDTH(ADDR_WIDTH), .DATA_WIDTH(DATA_WIDTH), .MIC_BITS(MIC_BITS))
FFT
(
.clk(clk_2M5),
.rst(rst),
.start(start),
.mic_we(mic_we),
.mic_addr(mic_addr),
.mic_data(mic_data),
.vga_addr(vga_addr),
.vga_data_r(vga_data_r),
.vga_data_i(vga_data_i),
.done(done)
);
vga_generator
#(.ADDR_WIDTH(ADDR_WIDTH), .DATA_WIDTH(DATA_WIDTH), .MEM_DATA_WIDTH(9))
vga
(
.done(done),
.vga_clk(clk_25M),
.FFT_clk(clk_2M5),
.rst(rst),
.FFT_addr(vga_addr),
.FFT_data_r(vga_data_r),
.FFT_data_i(vga_data_i),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
.VGA_B(VGA_B),
.VGA_HS(VGA_HS),
.VGA_VS(VGA_VS)
);
endmodule