-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpipeem.v
28 lines (27 loc) · 1.08 KB
/
pipeem.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
module pipeem(clk,writerege,writerege2,aluoute,aluoute2,writedatae,writedatae2,memwritee,memwritee2,
regwritee,regwritee2,memtorege,memtorege2,regwritem,regwritem2,memtoregm,memtoregm2,
memwritem,memwritem2,writeregm,writeregm2,aluoutm,aluoutm2,writedatam,writedatam2,stallm,stallm2);
input clk;
input [4:0] writerege,writerege2;
input [31:0] aluoute,writedatae,aluoute2,writedatae2;
input memwritee,memwritee2,regwritee,regwritee2,memtorege,memtorege2,stallm,stallm2;
output reg regwritem,memtoregm,memwritem,regwritem2,memtoregm2,memwritem2;
output reg [4:0] writeregm, writeregm2;
output reg [31:0] aluoutm,writedatam,aluoutm2,writedatam2;
always @ (posedge clk) begin
if (!stallm) begin
regwritem<=regwritee;
memtoregm<=memtorege;
memwritem<=memwritee;
aluoutm<=aluoute;
writedatam<=writedatae;
writeregm<=writerege;
regwritem2<=regwritee2;
memtoregm2<=memtorege2;
memwritem2<=memwritee2;
aluoutm2<=aluoute2;
writedatam2<=writedatae2;
writeregm2<=writerege2;
end
end
endmodule