-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrcB_mux.sv
46 lines (44 loc) · 989 Bytes
/
srcB_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
44
45
46
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 08/17/2024 02:49:05 PM
// Design Name:
// Module Name: srcB_mux
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module srcB_mux(
input [2:0] alu_srcB,
input [31:0] rs2,
input [31:0] I_Type,
input [31:0] S_Type,
input [31:0] PC,
input [31:0] csr_RD,
output logic [31:0] srcB
);
always_comb begin
case(alu_srcB)
3'b000:
srcB=rs2;
3'b001:
srcB=I_Type;
3'b010:
srcB=S_Type;
3'b011:
srcB=PC;
default:
srcB=csr_RD;
endcase
end
endmodule