diff options
Diffstat (limited to 'rtl/src/alu_b_src_mux.v')
-rw-r--r-- | rtl/src/alu_b_src_mux.v | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rtl/src/alu_b_src_mux.v b/rtl/src/alu_b_src_mux.v new file mode 100644 index 0000000..5932f9e --- /dev/null +++ b/rtl/src/alu_b_src_mux.v @@ -0,0 +1,21 @@ +module alu_b_src_mux ( + input [31:0] src_rd2_buf, + input [31:0] src_imm, + + input [1:0] alu_b_src, + + output reg [31:0] alu_b +); + +`include "include/consts.vh" + +always @(*) begin + case (alu_b_src) + ALU_B_SRC_RD2_BUF: alu_b = src_rd2_buf; + ALU_B_SRC_IMM: alu_b = src_imm; + ALU_B_SRC_4: alu_b = 32'h4; + default: alu_b = 32'b0; + endcase +end + +endmodule |