Skip to content

Commit

Permalink
Update Branch_Addr_Calc.sv
Browse files Browse the repository at this point in the history
  • Loading branch information
gil92723 committed Oct 30, 2023
1 parent 582b9ba commit 4477120
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rtl/Branch_Addr_Calc.sv
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ module Branch_Addr_Calc # (

always_comb begin
case(addr_mode)
PC: begin
PC:
branch_addr = pc_in + imm;
case (branch_taken)
2'b00: npc = pc_in;
2'b01: npc = branch_addr;
end
RD: begin
RD:
branch_addr = imm + rs1d;
case (branch_taken)
2'b00: npc = pc_in;
2'b01: npc = branch_addr;
end
default: begin
default:
branch_addr = pc_in + imm;
npc = pc_in;
end
endcase
end

Expand Down

0 comments on commit 4477120

Please sign in to comment.