Skip to content

Commit

Permalink
[dv,mem_bkdr_util] Move otp specific code to otp_ctrl
Browse files Browse the repository at this point in the history
Change the code to take a handle to the OTP mem_bkdr_util instance,
and use that to perform plain reads and writes to the underlying
memory.

The otp_ctrl code in mem_bkdr_util was making this utility to become
top-specific, which is wrong for a generic utility, and caused build
failures.

Change the uses of the affected functions in top_earlgrey dv code.

The main change is the move of hw/dv/sv/mem_bkdr_util/mem_bkdr_util__otp.sv
to hw/ip_templates/otp_ctrl/dv/ev/otp_ctrl_mem_bkdr_util_pkg.sv, and
changing the functions to take a mem_bkdr_util handle. For some reason
git didn't detect this as a move.

Part of #25891

Signed-off-by: Guillermo Maturana <[email protected]>
  • Loading branch information
matutem committed Jan 17, 2025
1 parent 80f1a08 commit d14ce98
Show file tree
Hide file tree
Showing 39 changed files with 979 additions and 242 deletions.
3 changes: 0 additions & 3 deletions hw/dv/sv/mem_bkdr_util/mem_bkdr_util.core
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ filesets:
- lowrisc:prim:cipher_pkg:0.1
- lowrisc:prim:secded:0.1
- lowrisc:ip:otp_ctrl_pkg:1.0
- lowrisc:ip_interfaces:otp_ctrl_top_specific_pkg
- lowrisc:ip_interfaces:flash_ctrl_pkg
- lowrisc:dv:digestpp_dpi
- lowrisc:ip:kmac_pkg
files:
- otp_scrambler_pkg.sv
- sram_scrambler_pkg.sv
- mem_bkdr_util_pkg.sv
- mem_bkdr_util.sv: {is_include_file: true}
- mem_bkdr_util__otp.sv: {is_include_file: true}
- mem_bkdr_util__rom.sv: {is_include_file: true}
- mem_bkdr_util__sram.sv: {is_include_file: true}
- mem_bkdr_util__flash.sv: {is_include_file: true}
Expand Down
3 changes: 0 additions & 3 deletions hw/dv/sv/mem_bkdr_util/mem_bkdr_util.sv
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,6 @@ class mem_bkdr_util extends uvm_object;
addr, rw_data, err_mask, rw_data ^ err_mask), UVM_HIGH)
endfunction

// Wrapper function for backdoor write OTP partitions.
`include "mem_bkdr_util__otp.sv"

// Wrapper functions for encrypted SRAM reads and writes.
`include "mem_bkdr_util__sram.sv"

Expand Down
188 changes: 0 additions & 188 deletions hw/dv/sv/mem_bkdr_util/mem_bkdr_util__otp.sv

This file was deleted.

4 changes: 0 additions & 4 deletions hw/dv/sv/mem_bkdr_util/mem_bkdr_util_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ package mem_bkdr_util_pkg;
import bus_params_pkg::BUS_AW;
import dv_utils_pkg::uint32_t, dv_utils_pkg::addr_range_t;
import lc_ctrl_state_pkg::*;
import otp_ctrl_part_pkg::*;
import otp_ctrl_top_specific_pkg::*;
import otp_ctrl_reg_pkg::*;
import otp_scrambler_pkg::*;
import prim_secded_pkg::*;
import sram_scrambler_pkg::*;
import uvm_pkg::*;
Expand Down
1 change: 1 addition & 0 deletions hw/ip_templates/otp_ctrl/dv/env/otp_ctrl_env.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ filesets:
- lowrisc:dv:mem_bkdr_util
- lowrisc:dv:crypto_dpi_present
- lowrisc:dv:lc_ctrl_dv_utils
- ${instance_vlnv("lowrisc:dv:otp_ctrl_mem_bkdr_util:0.1")}
files:
- otp_ctrl_env_pkg.sv
- otp_ctrl_if.sv
Expand Down
25 changes: 25 additions & 0 deletions hw/ip_templates/otp_ctrl/dv/env/otp_ctrl_mem_bkdr_util.core.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CAPI=2:
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: ${instance_vlnv("lowrisc:dv:otp_ctrl_mem_bkdr_util:0.1")}
description: "OTP_CTRL mem_bkdr_util support package"
virtual:
- lowrisc:ip_interfaces:otp_ctrl_mem_bkdr_util

filesets:
files_dv:
depend:
- lowrisc:dv:mem_bkdr_util
- lowrisc:dv:crypto_dpi_present
- lowrisc:dv:lc_ctrl_dv_utils
- ${instance_vlnv("lowrisc:ip:otp_ctrl_top_specific_pkg:1.0")}
files:
- otp_scrambler_pkg.sv
- otp_ctrl_mem_bkdr_util_pkg.sv
file_type: systemVerilogSource

targets:
default:
filesets:
- files_dv
Loading

0 comments on commit d14ce98

Please sign in to comment.