[otp_ctrl] Several small lint fixes
Signed-off-by: Michael Schaffner <msf@google.com>
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl.sv
index 78b553a..1c9f28d 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl.sv
@@ -198,7 +198,8 @@
.intg_error_o( ),
.rdata_i ( tlul_rdata ),
.rvalid_i ( tlul_rvalid ),
- .rerror_i ( tlul_rerror )
+ .rerror_i ( tlul_rerror ),
+ .req_type_o ( )
);
logic [NumPart-1:0] tlul_part_sel_oh;
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
index a378296..9efa78f 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_dai.sv
@@ -637,9 +637,9 @@
logic [NumPart-1:0] part_sel_oh;
for (genvar k = 0; k < NumPart; k++) begin : gen_part_sel
- localparam int PartEndInt = int'(PartInfo[k].offset) + int'(PartInfo[k].size);
- localparam int DigestOffsetInt = PartEndInt - ScrmblBlockWidth / 8;
- localparam int DigestAddrLutInt = DigestOffsetInt >> OtpAddrShift;
+ localparam int unsigned PartEndInt = 32'(PartInfo[k].offset) + 32'(PartInfo[k].size);
+ localparam int unsigned DigestOffsetInt = PartEndInt - ScrmblBlockWidth / 8;
+ localparam int unsigned DigestAddrLutInt = DigestOffsetInt >> OtpAddrShift;
// PartEnd has an extra bit to cope with the case where offset + size overflows. However, we
// arrange the address map to make sure that PartEndInt is at most 1 << OtpByteAddrWidth. Check
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv
index 65a8fa9..bed4ed2 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_lci.sv
@@ -13,7 +13,7 @@
import otp_ctrl_part_pkg::*;
#(
// Lifecycle partition information
- parameter part_info_t Info = part_info_t'(0)
+ parameter part_info_t Info = PartInfoDefault
) (
input clk_i,
input rst_ni,
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 4ab5b75..679e504 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_buf.sv
@@ -13,7 +13,7 @@
import otp_ctrl_part_pkg::*;
#(
// Partition information.
- parameter part_info_t Info = part_info_t'(0),
+ parameter part_info_t Info = PartInfoDefault,
parameter logic [Info.size*8-1:0] DataDefault = '0
) (
input clk_i,
@@ -578,6 +578,11 @@
assign addr_calc = OtpByteAddrWidth'({cnt_q, {$clog2(ScrmblBlockWidth/8){1'b0}}}) + addr_base;
assign otp_addr_o = addr_calc[OtpByteAddrWidth-1:OtpAddrShift];
+ if (OtpAddrShift > 0) begin : gen_unused
+ logic unused_bits;
+ assign unused_bits = ^addr_calc[OtpAddrShift-1:0];
+ end
+
// Always transfer 64bit blocks.
assign otp_size_o = OtpSizeWidth'(unsigned'(ScrmblBlockWidth / OtpWidth) - 1);
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
index fd0cd0a..3fa247f 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
@@ -100,6 +100,17 @@
logic read_lock; // Whether the partition is read lockable (via digest)
} part_info_t;
+ parameter part_info_t PartInfoDefault = '{
+ variant: Unbuffered,
+ offset: '0,
+ size: OtpByteAddrWidth'('hFF),
+ key_sel: key_sel_e'('0),
+ secret: 1'b0,
+ hw_digest: 1'b0,
+ write_lock: 1'b0,
+ read_lock: 1'b0
+ };
+
////////////////////////
// Partition Metadata //
////////////////////////
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv.tpl b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv.tpl
index dbd3139..9ecd737 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv.tpl
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv.tpl
@@ -112,6 +112,17 @@
logic read_lock; // Whether the partition is read lockable (via digest)
} part_info_t;
+ parameter part_info_t PartInfoDefault = '{
+ variant: Unbuffered,
+ offset: '0,
+ size: OtpByteAddrWidth'('hFF),
+ key_sel: key_sel_e'('0),
+ secret: 1'b0,
+ hw_digest: 1'b0,
+ write_lock: 1'b0,
+ read_lock: 1'b0
+ };
+
////////////////////////
// Partition Metadata //
////////////////////////
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 346162c..95cb60a 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_unbuf.sv
@@ -13,7 +13,7 @@
import otp_ctrl_part_pkg::*;
#(
// Partition information.
- parameter part_info_t Info = part_info_t'(0)
+ parameter part_info_t Info = PartInfoDefault
) (
input clk_i,
input rst_ni,
@@ -306,6 +306,11 @@
assign addr_calc = (otp_addr_sel == DigestAddr) ? DigestOffset : {tlul_addr_q, 2'b00};
assign otp_addr_o = addr_calc[OtpByteAddrWidth-1:OtpAddrShift];
+ if (OtpAddrShift > 0) begin : gen_unused
+ logic unused_bits;
+ assign unused_bits = ^addr_calc[OtpAddrShift-1:0];
+ end
+
// Request 32bit except in case of the digest.
assign otp_size_o = (otp_addr_sel == DigestAddr) ?
OtpSizeWidth'(unsigned'(ScrmblBlockWidth / OtpWidth - 1)) :
diff --git a/hw/ip/prim_generic/rtl/prim_generic_otp.sv b/hw/ip/prim_generic/rtl/prim_generic_otp.sv
index 05f9d58..7a2d970 100644
--- a/hw/ip/prim_generic/rtl/prim_generic_otp.sv
+++ b/hw/ip/prim_generic/rtl/prim_generic_otp.sv
@@ -81,7 +81,8 @@
.intg_error_o( ),
.rdata_i ( tlul_rdata_q ),
.rvalid_i ( tlul_rvalid_q ),
- .rerror_i ( '0 )
+ .rerror_i ( '0 ),
+ .req_type_o ( )
);
always_ff @(posedge clk_i or negedge rst_ni) begin : p_tlul_testreg