Skip to content

Commit

Permalink
[darjeeling,dv] Copy pwrmgr_if from integrated
Browse files Browse the repository at this point in the history
Package pwrmgr interface to also make it available outside of the
main testbench

Signed-off-by: Robert Schilling <[email protected]>
  • Loading branch information
Razer6 authored and andreaskurth committed Dec 13, 2024
1 parent b92d43a commit c419cea
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 3 deletions.
34 changes: 34 additions & 0 deletions hw/top_darjeeling/dv/env/pwrmgr_low_power_if.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// Legacy pwrmgr_if.sv has import pwrmgr_env_pkg::*;
// inside interface.
// To avoid unnecessary compile overhead, create separate interface
// probing low_power_o
interface pwrmgr_low_power_if (
input logic clk,
input logic fast_clk,
input logic rst_n
);

// low_power indicates the PWRMGR starts entering low power state. When the
// signal is high, the chip does not yet complete the power down.
logic low_power;

// If `in_sleep` is 1, it indicates, the chip is in either normal sleep or
// deep sleep state.
logic in_sleep;

// Deep Power down indicator (while `low_power` is high)
logic deep_powerdown;

// slow clock
clocking cb @(posedge clk);
endclocking

// main clock
clocking fast_cb @(posedge fast_clk);
endclocking

endinterface // pwrmgr_low_power_if
38 changes: 38 additions & 0 deletions hw/top_darjeeling/dv/pwrmgr_low_power_if.core
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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: "lowrisc:systems:pwrmgr_if:0.1"
description: "Power manager interface"

filesets:
files_rtl:
files:
- env/pwrmgr_low_power_if.sv
file_type: systemVerilogSource

files_verilator_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable

files_ascentlint_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable

files_veriblelint_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable

targets:
default: &default_target
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- tool_veriblelint ? (files_veriblelint_waiver)
- files_rtl
4 changes: 1 addition & 3 deletions hw/top_earlgrey/dv/env/pwrmgr_low_power_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//
// sample only pwrmgr.low_power_o
//
// Legacy pwrmgr_if.sv has import pwrmgr_env_pkg::*;
// inside interface.
// To avoid unnecessary compile overhead, create separte interface
// To avoid unnecessary compile overhead, create separate interface
// probing low_power_o
interface pwrmgr_low_power_if (
input logic clk,
Expand Down

0 comments on commit c419cea

Please sign in to comment.