From c41dfa9aeaa899c48543a7259aa5b07136412c88 Mon Sep 17 00:00:00 2001 From: Michael Schaffner Date: Tue, 13 Feb 2024 15:28:00 -0800 Subject: [PATCH] [otp_ctrl] Fix OTP_CTRL enums 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 --- hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv | 2 +- hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv | 2 +- hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv index da424beb60995..b975b6e083226 100644 --- a/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv +++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv @@ -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 diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv index 06cfa3e9e8835..e2f0e54a5e166 100644 --- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv +++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv @@ -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); diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv index d582c1276c14a..28fbf421bf9da 100644 --- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv +++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv @@ -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);