-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmips.v
90 lines (85 loc) · 1.6 KB
/
mips.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
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2017/11/07 10:58:03
// Design Name:
// Module Name: mips
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module mips(
input wire clk,rst,
output wire[31:0] pcF,
input wire[31:0] instrF,
output wire memwriteM,
output wire[31:0] aluoutM,writedataM,
input wire[31:0] readdataM
);
wire [31:0] instrD;
wire regdstE,alusrcE,pcsrcD,memtoregE,memtoregM,memtoregW,
regwriteE,regwriteM,regwriteW;
wire [4:0] alucontrolE;
wire flushE,equalD;
wire is_IMM;
wire hilo_writeM,hilo_writeW;
wire hi_to_regM;
wire lo_to_regM;
controller c(
clk,rst,
//decode stage
instrD,
pcsrcD,branchD,equalD,jumpD,
is_IMM,
//execute stage
flushE,
memtoregE,alusrcE,
regdstE,regwriteE,
alucontrolE,
//mem stage
memtoregM,memwriteM,
regwriteM,hilo_writeM,hi_to_regM,lo_to_regM,
//write back stage
memtoregW,regwriteW,hilo_writeW
);
datapath dp(
clk,rst,
//fetch stage
pcF,
instrF,
//decode stage
pcsrcD,branchD,
jumpD,
equalD,
instrD,
is_IMM,
//execute stage
memtoregE,
alusrcE,regdstE,
regwriteE,
alucontrolE,
flushE,
//mem stage
memtoregM,
regwriteM,
aluoutM,writedataM,
readdataM,
hilo_writeM,
hi_to_regM,
lo_to_regM,
//writeback stage
memtoregW,
regwriteW,
hilo_writeW
);
endmodule