blob: 4ab45093e3f5fceada2599280577cd7eaaf7249b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// mem addr mux:
// Selects source mem addr.
module mem_addr_src_mux (
input [31:0] src_pc,
input [31:0] src_result,
input mem_addr_src,
output reg [31:0] mem_addr
);
`include "include/consts.vh"
always @(*) begin
case (mem_addr_src)
MEM_ADDR_SRC_PC: mem_addr = src_pc;
MEM_ADDR_SRC_RESULT: mem_addr = src_result;
default: mem_addr = 32'b0;
endcase
end
endmodule
|