-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystem.v
More file actions
60 lines (49 loc) · 1.3 KB
/
Copy pathSystem.v
File metadata and controls
60 lines (49 loc) · 1.3 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
module System (
input hclk,
input rst,
input en,
input rw,
input [6:0] addr,
input [31:0] w_data,
input [3:0] transfer_len,
input [2:0] clk_div_val,
input cpol,
input cpha
);
wire sclk;
wire cs;
wire mosi;
wire miso;
Master master (
.m_hclk (hclk),
.m_rst (rst),
.m_en (en),
// testbench to rd_wr_shift
.m_rw (rw),
.m_addr (addr),
.m_w_data (w_data),
// testbench to data_rem
.m_transfer_len (transfer_len),
// tesetbench to sclk_gen
.m_clk_div_val (clk_div_val),
// SPI modes
.m_cpol (cpol),
.m_cpha (cpha),
// SPI interface
.m_miso (miso),
.m_sclk (sclk),
.m_cs (cs),
.m_mosi (mosi)
);
Slave slave (
.s_rst (rst),
// spi mode parameters
.s_cpol(cpol),
.s_cpha(cpha),
// spi interface
.s_sclk(sclk),
.s_cs (cs),
.s_mosi(mosi),
.s_miso(miso)
);
endmodule