Skip to content

Commit

Permalink
[otp_ctrl/dv] Update otp_ctrl_env_pkg template
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Schaffner <[email protected]>

[otp_ctrl/dv] Update otp_ctrl_env_pkg template

Signed-off-by: Michael Schaffner <[email protected]>
  • Loading branch information
msfschaffner committed Jan 24, 2024
1 parent d69f033 commit 978233e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 34 deletions.
52 changes: 27 additions & 25 deletions hw/ip/otp_ctrl/data/otp_ctrl_env_pkg.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
${gen_comment}
<%
from topgen.lib import Name

parts_without_lc = [part for part in otp_mmap.config["partitions"] if
part["variant"] in ["Buffered", "Unbuffered"]]
%>\
package otp_ctrl_env_pkg;
// dep packages
import uvm_pkg::*;
Expand Down Expand Up @@ -71,26 +77,24 @@ package otp_ctrl_env_pkg;

// lc does not have dai access
parameter int PART_BASE_ADDRS [NumPart-1] = {
VendorTestOffset,
CreatorSwCfgOffset,
OwnerSwCfgOffset,
HwCfg0Offset,
HwCfg1Offset,
Secret0Offset,
Secret1Offset,
Secret2Offset
% for part in parts_without_lc:
<%
part_name = Name.from_snake_case(part["name"])
part_name_camel = part_name.as_camel_case()
%>\
${part_name_camel}Offset${"" if loop.last else ","}
% endfor
};

// lc does not have digest
parameter int PART_OTP_DIGEST_ADDRS [NumPart-1] = {
VendorTestDigestOffset >> 2,
CreatorSwCfgDigestOffset >> 2,
OwnerSwCfgDigestOffset >> 2,
HwCfg0DigestOffset >> 2,
HwCfg1DigestOffset >> 2,
Secret0DigestOffset >> 2,
Secret1DigestOffset >> 2,
Secret2DigestOffset >> 2
% for part in parts_without_lc:
<%
part_name = Name.from_snake_case(part["name"])
part_name_camel = part_name.as_camel_case()
%>\
${part_name_camel}DigestOffset >> 2${"" if loop.last else ","}
% endfor
};

// types
Expand All @@ -101,15 +105,13 @@ package otp_ctrl_env_pkg;
} otp_intr_e;

typedef enum bit [5:0] {
OtpVendorTestErrIdx,
OtpCreatorSwCfgErrIdx,
OtpOwnerSwCfgErrIdx,
OtpHwCfg0ErrIdx,
OtpHwCfg1ErrIdx,
OtpSecret0ErrIdx,
OtpSecret1ErrIdx,
OtpSecret2ErrIdx,
OtpLifeCycleErrIdx,
% for part in otp_mmap.config["partitions"]:
<%
part_name = Name.from_snake_case(part["name"])
part_name_camel = part_name.as_camel_case()
%>\
Otp${part_name_camel}ErrIdx,
% endfor
OtpDaiErrIdx,
OtpLciErrIdx,
OtpTimeoutErrIdx,
Expand Down
15 changes: 6 additions & 9 deletions hw/ip/otp_ctrl/dv/env/otp_ctrl_env_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,20 @@ package otp_ctrl_env_pkg;
CreatorSwCfgOffset,
OwnerSwCfgOffset,
HwCfg0Offset,
HwCfg1Offset,
Secret0Offset,
Secret1Offset,
Secret2Offset
};

// lc does not have digest
parameter int PART_OTP_DIGEST_ADDRS [NumPart-1] = {
VendorTestDigestOffset >> 2,
VendorTestDigestOffset >> 2,
CreatorSwCfgDigestOffset >> 2,
OwnerSwCfgDigestOffset >> 2,
HwCfg0DigestOffset >> 2,
HwCfg1DigestOffset >> 2,
Secret0DigestOffset >> 2,
Secret1DigestOffset >> 2,
Secret2DigestOffset >> 2
OwnerSwCfgDigestOffset >> 2,
HwCfg0DigestOffset >> 2,
Secret0DigestOffset >> 2,
Secret1DigestOffset >> 2,
Secret2DigestOffset >> 2
};

// types
Expand All @@ -107,7 +105,6 @@ package otp_ctrl_env_pkg;
OtpCreatorSwCfgErrIdx,
OtpOwnerSwCfgErrIdx,
OtpHwCfg0ErrIdx,
OtpHwCfg1ErrIdx,
OtpSecret0ErrIdx,
OtpSecret1ErrIdx,
OtpSecret2ErrIdx,
Expand Down

0 comments on commit 978233e

Please sign in to comment.