-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg_mux.sv
43 lines (41 loc) · 928 Bytes
/
reg_mux.sv
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 08/17/2024 02:49:05 PM
// Design Name:
// Module Name: reg_mux
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module reg_mux(
input [1:0] rf_wr_sel,
input [31:0] PC_Plus_Four,
input [31:0] csr_RD,
input [31:0] DOUT2,
input [31:0] alu_res,
output logic [31:0] wd
);
always_comb begin
case(rf_wr_sel)
2'b00:
wd=PC_Plus_Four;
2'b01:
wd=csr_RD;
2'b10:
wd=DOUT2;
default:
wd=alu_res;
endcase
end
endmodule