RVSCC/rtl/jump_control.sv
Mario Romero 24a5622103
Some checks are pending
continuous-integration/drone/push Build is pending
Add 5 stage pipeline test and move timescale to include
2023-02-27 23:22:34 -03:00

23 lines
485 B
Systemverilog

`include "timescale.sv"
module jump_control (
input logic jump,
input logic branch,
input logic branch_alu_neg,
input logic zero,
output logic pc_src
);
logic alu_result, branch_result;
assign alu_result = !zero;
always_comb begin
case (branch_alu_neg)
'd0: branch_result = alu_result;
'd1: branch_result = !alu_result;
default: branch_result = 1'dx;
endcase
end
assign pc_src = (branch & branch_result) | jump;
endmodule