-
Notifications
You must be signed in to change notification settings - Fork 0
/
top_example.v
60 lines (53 loc) · 1022 Bytes
/
top_example.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
`timescale 1ns/1ps
`include "cpu.v"
`include "io/InstMem.v"
`include "io/DataMem.v"
module TOP (
input inclk, // CPU clock
input rstn, // CPU reset
output outclk // output clock
);
wire [31:0] PC;
wire [31:0] inst;
wire [31:0] DM_addr;
wire [31:0] DM_rdata;
wire [31:0] DM_wdata;
wire [31:0] ALU_out;
wire IM_R;
wire DM_CS;
wire DM_R;
wire DM_W;
wire [31:0] test_rf_data; // ? TEST INTERFACE
wire [31:0] test_rf_addr; // ? TEST INTERFACE
CPU sccpu(
inclk,
rstn,
inst,
DM_rdata,
outclk,
IM_R,
DM_CS,
DM_R,
DM_W,
PC,
ALU_out,
DM_addr,
DM_wdata,
test_rf_addr, // ? TEST INTERFACE
test_rf_data // ? TEST INTERFACE
);
InstMem imem(
IM_R,
PC,
inst
);
DataMem dmem(
outclk,
DM_CS,
DM_R,
DM_W,
DM_addr,
DM_wdata,
DM_rdata
);
endmodule