-
Notifications
You must be signed in to change notification settings - Fork 0
/
icache.sv
73 lines (69 loc) · 1.6 KB
/
icache.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
module icache
(
input clk,
/*inputs from cpu*/
input [31:0] mem_address, mem_wdata,
input logic mem_read, mem_write,
input [3:0] mem_byte_enable,
/*inputs from pmem*/
input [255:0] pmem_rdata,
input logic pmem_resp,
/*outputs to cpu*/
output [31:0] mem_rdata,
output logic mem_resp,
/*outputs to pmem*/
output [31:0] pmem_address,
output [255:0] pmem_wdata,
output logic pmem_read, pmem_write
);
logic pmem_we, pmarmux_sel, hit, replace, dirty, datamux_sel,load_addr;
icache_datapath datapath
(
.clk(clk),
/*signals given by CPU*/
.mem_address(mem_address),
.mem_wdata(mem_wdata),
.mem_read(mem_read),
.mem_write(mem_write), ////double check!!!!!!!!!!!!!
.mem_byte_enable(mem_byte_enable),
/*signals given by cache control unit*/
.pmem_we(pmem_we),
.pmarmux_sel(pmarmux_sel),
.datamux_sel(datamux_sel),
.load_addr(load_addr),
/*signals given by physical memory*/
.pmem_rdata(pmem_rdata),
/*signals to CPU*/
.mem_rdata(mem_rdata),
/*signals to cache control unit*/
.hit(hit),
.replace(replace),
.dirty(dirty),
/*signals to physical memory*/
.pmem_address(pmem_address),
.pmem_wdata(pmem_wdata)
);
icache_control cache_control
(
.clk(clk),
/*signals from datapath*/
.hit(hit),
.replace(replace),
.dirty(dirty),
/*signals from cpu*/
.mem_read(mem_read),
.mem_write(mem_write),
/*signals from pmem*/
.pmem_resp(pmem_resp),
/*signals to datapath*/
.pmem_we(pmem_we),
.pmarmux_sel(pmarmux_sel),
.datamux_sel(datamux_sel),
.load_addr(load_addr),
/*signals to cpu*/
.mem_resp(mem_resp),
/*signals to pmem*/
.pmem_read(pmem_read),
.pmem_write(pmem_write)
);
endmodule: icache