-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharm.v
63 lines (63 loc) · 1.1 KB
/
arm.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
61
62
63
`include "control_unit.v"
`include "data_mem.v"
module arm (
clk,
reset,
PC,
Instr,
MemWrite,
ALUResult,
WriteData,
ReadData
);
input wire clk;
input wire reset;
output wire [31:0] PC;
input wire [31:0] Instr;
output wire MemWrite;
output wire [31:0] ALUResult;
output wire [31:0] WriteData;
input wire [31:0] ReadData;
wire [3:0] ALUFlags;
wire RegWrite;
wire ALUSrc;
wire MemtoReg;
wire PCSrc;
wire RegByte;
wire [1:0] RegSrc;
wire [1:0] ImmSrc;
wire [2:0] ALUControl;
controller c(
.clk(clk),
.reset(reset),
.Instr(Instr[31:12]),
.ALUFlags(ALUFlags),
.RegSrc(RegSrc),
.RegWrite(RegWrite),
.ImmSrc(ImmSrc),
.ALUSrc(ALUSrc),
.ALUControl(ALUControl),
.MemWrite(MemWrite),
.MemtoReg(MemtoReg),
.PCSrc(PCSrc),
.RegByte(RegByte)
);
datapath dp(
.clk(clk),
.reset(reset),
.RegSrc(RegSrc),
.RegWrite(RegWrite),
.ImmSrc(ImmSrc),
.ALUSrc(ALUSrc),
.ALUControl(ALUControl),
.MemtoReg(MemtoReg),
.PCSrc(PCSrc),
.ALUFlags(ALUFlags),
.PC(PC),
.Instr(Instr),
.ALUResult(ALUResult),
.WriteData(WriteData),
.ReadData(ReadData),
.RegByte(RegByte)
);
endmodule