Skip to content

Commit

Permalink
improve case coding style to improve CC
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Roch Coulon <[email protected]>
  • Loading branch information
Jean-Roch Coulon committed Nov 8, 2023
1 parent b2a59c9 commit d96d8ed
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions core/load_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -476,23 +476,27 @@ module load_unit
result_o = {{riscv::XLEN - 32 + 16{rdata_sign_bit}}, shifted_data[15:0]};
ariane_pkg::LB, ariane_pkg::LBU:
result_o = {{riscv::XLEN - 32 + 24{rdata_sign_bit}}, shifted_data[7:0]};
ariane_pkg::FLW: begin
default: begin
// FLW, FLH and FLB have been defined here in default case to improve Code Coverage
if (CVA6Cfg.FpPresent) begin
result_o = {{riscv::XLEN - 32{rdata_sign_bit}}, shifted_data[31:0]};
end
end
ariane_pkg::FLH: begin
if (CVA6Cfg.FpPresent) begin
result_o = {{riscv::XLEN - 32 + 16{rdata_sign_bit}}, shifted_data[15:0]};
end
end
ariane_pkg::FLB: begin
if (CVA6Cfg.FpPresent) begin
result_o = {{riscv::XLEN - 32 + 24{rdata_sign_bit}}, shifted_data[7:0]};
unique case (ldbuf_rdata.operation)
ariane_pkg::FLW: begin
result_o = {{riscv::XLEN - 32{rdata_sign_bit}}, shifted_data[31:0]};
end
ariane_pkg::FLH: begin
result_o = {{riscv::XLEN - 32 + 16{rdata_sign_bit}}, shifted_data[15:0]};
end
ariane_pkg::FLB: begin
result_o = {{riscv::XLEN - 32 + 24{rdata_sign_bit}}, shifted_data[7:0]};
end
default: begin
result_o = shifted_data[riscv::XLEN-1:0];
end
endcase
end else begin
result_o = shifted_data[riscv::XLEN-1:0];
end
end

default: result_o = shifted_data[riscv::XLEN-1:0];
endcase
end
// end result mux fast
Expand Down

0 comments on commit d96d8ed

Please sign in to comment.