-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.txt
126 lines (115 loc) · 4.21 KB
/
core.txt
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
`include "defines.vh"
module mycpu_core(
input wire clk,
input wire rst,
input wire [5:0] 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 [`IF_TO_ID_WD-1:0] if_to_id_bus;
wire [`ID_TO_EX_WD-1:0] id_to_ex_bus;
wire [`EX_TO_MEM_WD-1:0] ex_to_mem_bus;
wire [`MEM_TO_WB_WD-1:0] mem_to_wb_bus;
wire [`BR_WD-1:0] br_bus;
wire [`DATA_SRAM_WD-1:0] ex_dt_sram_bus;
wire [`WB_TO_RF_WD-1:0] wb_to_rf_bus;
wire [`StallBus-1:0] stall;
wire [4:0] ex_rf_waddr;
wire [4:0] mem_rf_waddr;
wire [31:0] ex_rf_data;
wire [31:0] mem_rf_wdata;
wire mem_rf_we;
wire ex_rf_we;
wire reg_31_wb;
wire [5:0]ex_opcode;
wire stallreq;
wire [65:0]mul_div_res_bus;
wire stallreq_for_ex;
IF u_IF(
.clk (clk ),
.rst (rst ),
.stall (stall ),
.br_bus (br_bus ),
.if_to_id_bus (if_to_id_bus ),
.inst_sram_en (inst_sram_en ),
.inst_sram_wen (inst_sram_wen ),
.inst_sram_addr (inst_sram_addr ),
.inst_sram_wdata (inst_sram_wdata )
);
ID u_ID(
.clk (clk ),
.rst (rst ),
.stall (stall ),
.stallreq (stallreq ),
.if_to_id_bus (if_to_id_bus ),
.inst_sram_rdata (inst_sram_rdata ),
.wb_to_rf_bus (wb_to_rf_bus ),
.id_to_ex_bus (id_to_ex_bus ),
.br_bus (br_bus ),
.ex_rf_waddr (ex_rf_waddr ),
.mem_rf_waddr (mem_rf_waddr ),
.ex_rf_data (ex_rf_data ),
.mem_rf_wdata (mem_rf_wdata ),
.mem_rf_we (mem_rf_we ),
.ex_rf_we (ex_rf_we ),
.ex_opcode (ex_opcode ),
.mul_div_res_bus (mul_div_res_bus )
);
EX u_EX(
.clk (clk ),
.rst (rst ),
.stall (stall ),
.id_to_ex_bus (id_to_ex_bus ),
.ex_to_mem_bus (ex_to_mem_bus ),
.data_sram_en (data_sram_en ),
.data_sram_wen (data_sram_wen ),
.data_sram_addr (data_sram_addr ),
.data_sram_wdata (data_sram_wdata ),
.ex_rf_waddr (ex_rf_waddr ),
.ex_rf_data (ex_rf_data ),
.ex_rf_we (ex_rf_we ),
.ex_opcode (ex_opcode ),
.stallreq_for_ex (stallreq_for_ex ),
.mul_div_res_bus (mul_div_res_bus )
);
MEM u_MEM(
.clk (clk ),
.rst (rst ),
.stall (stall ),
.ex_to_mem_bus (ex_to_mem_bus ),
.data_sram_rdata (data_sram_rdata ),
.mem_to_wb_bus (mem_to_wb_bus ),
.mem_rf_waddr (mem_rf_waddr ),
.mem_rf_wdata (mem_rf_wdata ),
.mem_rf_we (mem_rf_we )
);
WB u_WB(
.clk (clk ),
.rst (rst ),
.stall (stall ),
.mem_to_wb_bus (mem_to_wb_bus ),
.wb_to_rf_bus (wb_to_rf_bus ),
.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 )
);
CTRL u_CTRL(
.rst (rst ),
.stallreq_for_ex (stallreq_for_ex ),
.stallreq_for_load(stallreq),
.stall (stall )
);
endmodule