[otp_ctrl,lint] Explicitly compare multi-bit signals with zero
This is actually in our style guide ("Do not use multi-bit signals in
a boolean context"). The implicit boolean conversion also caused a
Verilator width warning. Use the relevant enum value (NoError)
instead.
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
index 5612a20..a378296 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
@@ -604,7 +604,7 @@
// an FsmStateError error code is assigned here, in case no error code has
// been assigned yet.
ErrorSt: begin
- if (!error_q) begin
+ if (error_q == NoError) begin
error_d = FsmStateError;
end
end
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv
index bdece58..e0392f0 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv
@@ -190,7 +190,7 @@
// Make sure the partition signals an error state if no error
// code has been latched so far, and lock the buffer regs down.
ErrorSt: begin
- if (!error_q) begin
+ if (error_q == NoError) begin
error_d = FsmStateError;
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 3cbfbb6..594cbd6 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv
@@ -517,7 +517,7 @@
// code has been latched so far, and lock the buffer regs down.
ErrorSt: begin
dout_gate_d = Locked;
- if (!error_q) begin
+ if (error_q == NoError) begin
error_d = FsmStateError;
end
// If we are in error state, we cannot execute the checks anymore.
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 97d7d5c..275583d 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv
@@ -251,7 +251,7 @@
// Make sure the partition signals an error state if no error
// code has been latched so far.
ErrorSt: begin
- if (!error_q) begin
+ if (error_q == NoError) begin
error_d = FsmStateError;
end