Skip to content

Commit

Permalink
[otp_ctrl] Fix OTP_CTRL enums
Browse files Browse the repository at this point in the history
This fixes an error due to a comparison between different enum types.
We can use casting here since the error patterns in question have the
same encodings in both enums.

Signed-off-by: Michael Schaffner <[email protected]>
  • Loading branch information
msfschaffner committed Feb 14, 2024
1 parent cb16ce2 commit a08791a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module otp_ctrl_dai
always_comb begin
otp_err = otp_err_e'(otp_err_i);
if (!PartInfo[part_idx].integrity &&
otp_err_i inside {MacroEccCorrError, MacroEccUncorrError}) begin
otp_err_e'(otp_err_i) inside {MacroEccCorrError, MacroEccUncorrError}) begin
otp_err = NoError;
end
end
Expand Down
2 changes: 1 addition & 1 deletion hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ module otp_ctrl_part_buf
end else begin : gen_no_integrity
assign otp_cmd_o = prim_otp_pkg::ReadRaw;
always_comb begin
if (otp_err_i inside {MacroEccCorrError, MacroEccUncorrError}) begin
if (otp_err_e'(otp_err_i) inside {MacroEccCorrError, MacroEccUncorrError}) begin
otp_err = NoError;
end else begin
otp_err = otp_err_e'(otp_err_i);
Expand Down
2 changes: 1 addition & 1 deletion hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module otp_ctrl_part_unbuf
end else begin : gen_no_integrity
assign otp_cmd_o = prim_otp_pkg::ReadRaw;
always_comb begin
if (otp_err_i inside {MacroEccCorrError, MacroEccUncorrError}) begin
if (otp_err_e'(otp_err_i) inside {MacroEccCorrError, MacroEccUncorrError}) begin
otp_err = NoError;
end else begin
otp_err = otp_err_e'(otp_err_i);
Expand Down

0 comments on commit a08791a

Please sign in to comment.