-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEX_Stage_Reg.v
46 lines (35 loc) · 1.28 KB
/
EX_Stage_Reg.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
`include "Defines.v"
module EX_Stage_Reg(
input clk, rst,
input freeze,
input wb_en_in, mem_r_en_in, mem_w_en_in,
input [`REGISTER_LEN - 1:0] alu_res_in, val_Rm_in,
input [`REG_ADDRESS_LEN - 1:0] dest_in,
input branch_taken_in,
output wb_en_out, mem_r_en_out, mem_w_en_out,
output [`REGISTER_LEN - 1:0] alu_res_out, val_Rm_out,
output [`REG_ADDRESS_LEN - 1:0] dest_out,
output branch_taken_out
);
Register #(.WORD_LENGTH(1)) reg_wb_en(.clk(clk), .rst(rst),
.ld(~freeze), .in(wb_en_in), .out(wb_en_out)
);
Register #(.WORD_LENGTH(1)) reg_mem_r_en(.clk(clk), .rst(rst),
.ld(~freeze), .in(mem_r_en_in), .out(mem_r_en_out)
);
Register #(.WORD_LENGTH(1)) reg_mem_w_en(.clk(clk), .rst(rst),
.ld(~freeze), .in(mem_w_en_in), .out(mem_w_en_out)
);
Register #(.WORD_LENGTH(`REGISTER_LEN)) reg_alu_res(.clk(clk), .rst(rst),
.ld(~freeze), .in(alu_res_in), .out(alu_res_out)
);
Register #(.WORD_LENGTH(`REGISTER_LEN)) reg_val_Rm(.clk(clk), .rst(rst),
.ld(~freeze), .in(val_Rm_in), .out(val_Rm_out)
);
Register #(.WORD_LENGTH(`REG_ADDRESS_LEN)) reg_dest(.clk(clk), .rst(rst),
.ld(~freeze), .in(dest_in), .out(dest_out)
);
Register #(.WORD_LENGTH(1)) reg_branch_taken(.clk(clk), .rst(rst),
.ld(~freeze), .in(branch_taken_in), .out(branch_taken_out)
);
endmodule