-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmycpu_top.v
60 lines (49 loc) · 1.75 KB
/
mycpu_top.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
`include "lib/defines.vh"
module mycpu_top(
input wire clk,
input wire resetn,
input wire [5:0] ext_int,
output wire inst_sram_en,
output wire [3:0] inst_sram_wen,
output wire [31:0] inst_sram_addr,
output wire [31:0] inst_sram_wdata,
input wire [31:0] inst_sram_rdata,
output wire data_sram_en,
output wire [3:0] data_sram_wen,
output wire [31:0] data_sram_addr,
output wire [31:0] data_sram_wdata,
input wire [31:0] data_sram_rdata,
output wire [31:0] debug_wb_pc,
output wire [3:0] debug_wb_rf_wen,
output wire [4:0] debug_wb_rf_wnum,
output wire [31:0] debug_wb_rf_wdata
);
wire [31:0] inst_sram_addr_v, data_sram_addr_v;
mycpu_core u_mycpu_core(
.clk (clk ),
.rst (~resetn ),
.int (ext_int ),
.inst_sram_en (inst_sram_en ),
.inst_sram_wen (inst_sram_wen ),
.inst_sram_addr (inst_sram_addr_v ),
.inst_sram_wdata (inst_sram_wdata ),
.inst_sram_rdata (inst_sram_rdata ),
.data_sram_en (data_sram_en ),
.data_sram_wen (data_sram_wen ),
.data_sram_addr (data_sram_addr_v ),
.data_sram_wdata (data_sram_wdata ),
.data_sram_rdata (data_sram_rdata ),
.debug_wb_pc (debug_wb_pc ),
.debug_wb_rf_wen (debug_wb_rf_wen ),
.debug_wb_rf_wnum (debug_wb_rf_wnum ),
.debug_wb_rf_wdata (debug_wb_rf_wdata )
);
mmu u0_mmu(
.addr_i (inst_sram_addr_v ),
.addr_o (inst_sram_addr )
);
mmu u1_mmu(
.addr_i (data_sram_addr_v ),
.addr_o (data_sram_addr )
);
endmodule