-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtop.sv
97 lines (85 loc) · 1.89 KB
/
top.sv
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
import definitions::*;
module top(
input logic clk_i,
input logic reset_i
);
localparam MEMORY_SIZE = 64 * 1024 * 8;
localparam MEMORY_DELAY_CYCLES = 5;
localparam CACHE_SIZE = 4 * 1024 * 8;
localparam CACHE_LINE_SIZE = 32 * 8;
localparam WORD_SIZE = 32;
localparam ADDR_SIZE = 32;
memory_interface # (
.ADDR_SIZE(ADDR_SIZE),
.CACHE_LINE_SIZE(CACHE_LINE_SIZE)
) memory_bus ();
memory_interface # (
.ADDR_SIZE(ADDR_SIZE),
.CACHE_LINE_SIZE(CACHE_LINE_SIZE)
) icache_memory_bus ();
memory_interface # (
.ADDR_SIZE(ADDR_SIZE),
.CACHE_LINE_SIZE(CACHE_LINE_SIZE)
) dcache_memory_bus ();
cache_interface # (
.ADDR_SIZE(ADDR_SIZE),
.WORD_SIZE(WORD_SIZE)
) icache_bus ();
cache_interface # (
.ADDR_SIZE(ADDR_SIZE),
.WORD_SIZE(WORD_SIZE)
) dcache_bus ();
memory_arbiter memory_arbiter(
.clk_i(clk_i),
.reset_i(reset_i),
.icache_memory_bus(icache_memory_bus),
.dcache_memory_bus(dcache_memory_bus),
.memory_bus(memory_bus)
);
memory # (
.SIZE(MEMORY_SIZE),
.CACHE_LINE_SIZE(CACHE_LINE_SIZE),
.ADDR_SIZE(ADDR_SIZE),
.DELAY_CYCLES(MEMORY_DELAY_CYCLES)
) memory (
.clk_i(clk_i),
.reset_i(reset_i),
.memory_bus(memory_bus)
);
cache # (
.SIZE(CACHE_SIZE),
.LINE_SIZE(CACHE_LINE_SIZE),
.WORD_SIZE(WORD_SIZE),
.ADDR_SIZE(ADDR_SIZE)
) icache (
.clk_i(clk_i),
.reset_i(reset_i),
.cache_bus(icache_bus),
.memory_bus(icache_memory_bus)
);
cache # (
.SIZE(CACHE_SIZE),
.LINE_SIZE(CACHE_LINE_SIZE),
.WORD_SIZE(WORD_SIZE),
.ADDR_SIZE(ADDR_SIZE)
) dcache (
.clk_i(clk_i),
.reset_i(reset_i),
.cache_bus(dcache_bus),
.memory_bus(dcache_memory_bus)
);
datapath # (
.ADDR_SIZE(ADDR_SIZE),
.WORD_SIZE(WORD_SIZE),
.CACHE_SIZE(CACHE_SIZE),
.CACHE_LINE_SIZE(CACHE_LINE_SIZE)
) datapath (
.clk_i(clk_i),
.reset_i(reset_i),
.icache_bus(icache_bus),
.dcache_bus(dcache_bus)
);
initial begin
$display("Tiny5 init");
end
endmodule