diff --git a/hw/ip/clkmgr/dv/env/clkmgr_env.core b/hw/ip/clkmgr/dv/env/clkmgr_env.core index 446d07e8ac1c38..f4b76088b71fca 100644 --- a/hw/ip/clkmgr/dv/env/clkmgr_env.core +++ b/hw/ip/clkmgr/dv/env/clkmgr_env.core @@ -9,7 +9,7 @@ filesets: depend: - lowrisc:dv:ralgen - lowrisc:dv:cip_lib - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:systems:clkmgr_pkg files: - clkmgr_csrs_if.sv diff --git a/hw/ip/flash_ctrl/data/flash_ctrl.sv.tpl b/hw/ip/flash_ctrl/data/flash_ctrl.sv.tpl index c3a0f51ff3930d..32e06b216a6067 100644 --- a/hw/ip/flash_ctrl/data/flash_ctrl.sv.tpl +++ b/hw/ip/flash_ctrl/data/flash_ctrl.sv.tpl @@ -97,7 +97,6 @@ module flash_ctrl (RdFifoDepth <= MaxFifoDepth)) - import flash_ctrl_reg_pkg::*; import prim_mubi_pkg::mubi4_t; flash_ctrl_core_reg2hw_t reg2hw; diff --git a/hw/ip/flash_ctrl/flash_ctrl_pkg.core b/hw/ip/flash_ctrl/flash_ctrl_pkg.core index 05ec6743f249fd..461ba7f7112473 100644 --- a/hw/ip/flash_ctrl/flash_ctrl_pkg.core +++ b/hw/ip/flash_ctrl/flash_ctrl_pkg.core @@ -11,7 +11,7 @@ filesets: - lowrisc:constants:top_pkg - lowrisc:prim:util - lowrisc:ip:lc_ctrl_pkg - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:jtag_pkg - lowrisc:ip:edn_pkg - "fileset_partner ? (partner:systems:ast_pkg)" diff --git a/hw/ip/flash_ctrl/rtl/flash_ctrl.sv b/hw/ip/flash_ctrl/rtl/flash_ctrl.sv index 1ac3a60fdac545..1141edd5906da5 100644 --- a/hw/ip/flash_ctrl/rtl/flash_ctrl.sv +++ b/hw/ip/flash_ctrl/rtl/flash_ctrl.sv @@ -97,7 +97,6 @@ module flash_ctrl (RdFifoDepth <= MaxFifoDepth)) - import flash_ctrl_reg_pkg::*; import prim_mubi_pkg::mubi4_t; flash_ctrl_core_reg2hw_t reg2hw; diff --git a/hw/ip/lc_ctrl/lc_ctrl.core b/hw/ip/lc_ctrl/lc_ctrl.core index 4dd46ccd9b4879..c1efa3b8984df2 100644 --- a/hw/ip/lc_ctrl/lc_ctrl.core +++ b/hw/ip/lc_ctrl/lc_ctrl.core @@ -17,7 +17,7 @@ filesets: - lowrisc:prim:sparse_fsm - lowrisc:ip:lc_ctrl_pkg - lowrisc:ip:tlul - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:otp_ctrl_pkg - lowrisc:ip:kmac_pkg - lowrisc:ip:rv_dm diff --git a/hw/ip/otp_ctrl/otp_ctrl.core b/hw/ip/otp_ctrl/otp_ctrl.core index 9f18a1a1a4414b..10971dd549c4c8 100644 --- a/hw/ip/otp_ctrl/otp_ctrl.core +++ b/hw/ip/otp_ctrl/otp_ctrl.core @@ -22,7 +22,7 @@ filesets: - lowrisc:prim:secded - lowrisc:ip:edn_requester - lowrisc:prim:sec_anchor - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:edn_pkg - lowrisc:prim:sparse_fsm - "fileset_partner ? (partner:systems:ast_pkg)" diff --git a/hw/ip/rstmgr/dv/sva/rstmgr_sva_ifs.core b/hw/ip/rstmgr/dv/sva/rstmgr_sva_ifs.core index bdedf685562ffe..eff742449cc7cd 100644 --- a/hw/ip/rstmgr/dv/sva/rstmgr_sva_ifs.core +++ b/hw/ip/rstmgr/dv/sva/rstmgr_sva_ifs.core @@ -8,7 +8,7 @@ filesets: files_dv: depend: - lowrisc:ip:lc_ctrl_pkg - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:rstmgr files: diff --git a/hw/ip/rstmgr/rstmgr_pkg.core b/hw/ip/rstmgr/rstmgr_pkg.core index 97511dfb561aea..6aa6f66e784e2d 100644 --- a/hw/ip/rstmgr/rstmgr_pkg.core +++ b/hw/ip/rstmgr/rstmgr_pkg.core @@ -9,7 +9,7 @@ filesets: files_rtl: depend: - lowrisc:ip:alert_handler_component - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:rstmgr_reg - lowrisc:ip_interfaces:alert_handler_reg - "fileset_top ? (lowrisc:systems:rstmgr_pkg)" diff --git a/hw/ip/rv_core_ibex/rv_core_ibex.core b/hw/ip/rv_core_ibex/rv_core_ibex.core index bd14e14a936b80..4b0c539c83a003 100644 --- a/hw/ip/rv_core_ibex/rv_core_ibex.core +++ b/hw/ip/rv_core_ibex/rv_core_ibex.core @@ -11,7 +11,7 @@ filesets: - lowrisc:ip:edn_requester - lowrisc:ip:lc_ctrl_pkg - lowrisc:ip:otp_ctrl_pkg - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:rv_core_ibex_pkg - lowrisc:ip:tlul - lowrisc:ip_interfaces:alert_handler_reg diff --git a/hw/ip_templates/pwrmgr/dv/env/pwrmgr_env.core b/hw/ip_templates/pwrmgr/dv/env/pwrmgr_env.core index d71a35180c2772..b19f07c3623908 100644 --- a/hw/ip_templates/pwrmgr/dv/env/pwrmgr_env.core +++ b/hw/ip_templates/pwrmgr/dv/env/pwrmgr_env.core @@ -9,7 +9,7 @@ filesets: depend: - lowrisc:dv:ralgen - lowrisc:dv:cip_lib - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg files: - pwrmgr_env_pkg.sv - pwrmgr_env_cfg.sv: {is_include_file: true} diff --git a/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core b/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core index 79631950495e26..8adac26d23551f 100644 --- a/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core +++ b/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core @@ -7,7 +7,7 @@ description: "PWRMGR to RSTMGR assertion interface." filesets: files_dv: depend: - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:prim:assert files: - pwrmgr_rstmgr_sva_if.sv diff --git a/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_sva.core b/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_sva.core index b71c2dede28a47..99665f575a8a31 100644 --- a/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_sva.core +++ b/hw/ip_templates/pwrmgr/dv/sva/pwrmgr_sva.core @@ -9,7 +9,7 @@ filesets: depend: - lowrisc:tlul:headers - lowrisc:fpv:csr_assert_gen - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:dv:clkmgr_pwrmgr_sva_if - lowrisc:dv:pwrmgr_rstmgr_sva_if files: diff --git a/hw/ip_templates/pwrmgr/pwrmgr.core.tpl b/hw/ip_templates/pwrmgr/pwrmgr.core.tpl new file mode 100644 index 00000000000000..3b83fcde96d924 --- /dev/null +++ b/hw/ip_templates/pwrmgr/pwrmgr.core.tpl @@ -0,0 +1,66 @@ +CAPI=2: +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 +name: ${instance_vlnv("lowrisc:ip:pwrmgr:0.1")} +description: "Power manager RTL" +virtual: + - lowrisc:ip_interfaces:pwrmgr + +filesets: + files_rtl: + depend: + - ${instance_vlnv("lowrisc:ip:pwrmgr_pkg:0.1")} + - ${instance_vlnv("lowrisc:ip:pwrmgr_reg:0.1")} + - lowrisc:ip:pwrmgr_component + file_type: systemVerilogSource + + files_verilator_waiver: + depend: + # common waivers + - lowrisc:lint:common + - lowrisc:lint:comportable + files: + - lint/pwrmgr.vlt + file_type: vlt + + files_ascentlint_waiver: + depend: + # common waivers + - lowrisc:lint:common + - lowrisc:lint:comportable + files: + - lint/pwrmgr.waiver + file_type: waiver + + files_veriblelint_waiver: + depend: + # common waivers + - lowrisc:lint:common + - lowrisc:lint:comportable + +parameters: + SYNTHESIS: + datatype: bool + paramtype: vlogdefine + + +targets: + default: &default_target + filesets: + - tool_verilator ? (files_verilator_waiver) + - tool_ascentlint ? (files_ascentlint_waiver) + - tool_veriblelint ? (files_veriblelint_waiver) + - files_rtl + toplevel: pwrmgr + + lint: + <<: *default_target + default_tool: verilator + parameters: + - SYNTHESIS=true + tools: + verilator: + mode: lint-only + verilator_options: + - "-Wall" diff --git a/hw/ip_templates/pwrmgr/pwrmgr.core b/hw/ip_templates/pwrmgr/pwrmgr_components.core similarity index 95% rename from hw/ip_templates/pwrmgr/pwrmgr.core rename to hw/ip_templates/pwrmgr/pwrmgr_components.core index c384dae955aaba..2069107cadb6b0 100644 --- a/hw/ip_templates/pwrmgr/pwrmgr.core +++ b/hw/ip_templates/pwrmgr/pwrmgr_components.core @@ -2,7 +2,7 @@ CAPI=2: # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -name: "lowrisc:ip:pwrmgr:0.1" +name: "lowrisc:ip:pwrmgr_component:0.1" description: "Power manager RTL" filesets: @@ -20,8 +20,7 @@ filesets: - lowrisc:prim:clock_buf - lowrisc:prim:measure - lowrisc:ip_interfaces:alert_handler_reg - - lowrisc:ip:pwrmgr_pkg - - lowrisc:ip:pwrmgr_reg + - lowrisc:ip_interfaces:pwrmgr_pkg files: - rtl/pwrmgr_cdc.sv - rtl/pwrmgr_slow_fsm.sv diff --git a/hw/ip_templates/pwrmgr/pwrmgr_pkg.core b/hw/ip_templates/pwrmgr/pwrmgr_pkg.core.tpl similarity index 79% rename from hw/ip_templates/pwrmgr/pwrmgr_pkg.core rename to hw/ip_templates/pwrmgr/pwrmgr_pkg.core.tpl index 3e83cde44fd128..f2d8b0995aaf57 100644 --- a/hw/ip_templates/pwrmgr/pwrmgr_pkg.core +++ b/hw/ip_templates/pwrmgr/pwrmgr_pkg.core.tpl @@ -2,13 +2,15 @@ CAPI=2: # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -name: "lowrisc:ip:pwrmgr_pkg:0.1" +name: ${instance_vlnv("lowrisc:ip:pwrmgr_pkg:0.1")} description: "Power manager package" +virtual: + - lowrisc:ip_interfaces:pwrmgr_pkg filesets: files_rtl: depend: - - lowrisc:ip:pwrmgr_reg + - ${instance_vlnv("lowrisc:ip:pwrmgr_reg")} files: - rtl/pwrmgr_pkg.sv file_type: systemVerilogSource diff --git a/hw/ip_templates/pwrmgr/pwrmgr_reg.core b/hw/ip_templates/pwrmgr/pwrmgr_reg.core.tpl similarity index 82% rename from hw/ip_templates/pwrmgr/pwrmgr_reg.core rename to hw/ip_templates/pwrmgr/pwrmgr_reg.core.tpl index c20cd917273d83..b2b8124fd5d04f 100644 --- a/hw/ip_templates/pwrmgr/pwrmgr_reg.core +++ b/hw/ip_templates/pwrmgr/pwrmgr_reg.core.tpl @@ -2,8 +2,10 @@ CAPI=2: # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -name: "lowrisc:ip:pwrmgr_reg:0.1" +name: ${instance_vlnv("lowrisc:ip:pwrmgr_reg:0.1")} description: "Power manager registers" +virtual: + - lowrisc:ip_interfaces:pwrmgr_reg filesets: files_rtl: diff --git a/hw/ip_templates/pwrmgr/rtl/pwrmgr_reg_pkg.sv b/hw/ip_templates/pwrmgr/rtl/pwrmgr_reg_pkg.sv deleted file mode 100644 index f55eaaf7a32b44..00000000000000 --- a/hw/ip_templates/pwrmgr/rtl/pwrmgr_reg_pkg.sv +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright lowRISC contributors. -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// -// Register Package auto-generated by `reggen` containing data structure - -package pwrmgr_reg_pkg; - - // Param list - parameter int NumWkups = 1; - parameter int NumRstReqs = 1; - - // Address widths within the block - parameter int BlockAw = 6; - - //////////////////////////// - // Typedefs for registers // - //////////////////////////// - - typedef struct packed { - logic q; - } pwrmgr_reg2hw_intr_state_reg_t; - - typedef struct packed { - logic q; - } pwrmgr_reg2hw_intr_enable_reg_t; - - typedef struct packed { - logic q; - logic qe; - } pwrmgr_reg2hw_intr_test_reg_t; - - typedef struct packed { - struct packed { - logic q; - } low_power_hint; - struct packed { - logic q; - } core_clk_en; - struct packed { - logic q; - } io_clk_en; - struct packed { - logic q; - } usb_clk_en_lp; - struct packed { - logic q; - } usb_clk_en_active; - struct packed { - logic q; - } main_pd_n; - } pwrmgr_reg2hw_control_reg_t; - - typedef struct packed { - logic q; - logic qe; - } pwrmgr_reg2hw_cfg_cdc_sync_reg_t; - - typedef struct packed { - logic q; - } pwrmgr_reg2hw_wakeup_en_mreg_t; - - typedef struct packed { - logic q; - } pwrmgr_reg2hw_reset_en_mreg_t; - - typedef struct packed { - logic q; - } pwrmgr_reg2hw_wake_info_capture_dis_reg_t; - - typedef struct packed { - struct packed { - logic q; - logic qe; - } reasons; - struct packed { - logic q; - logic qe; - } fall_through; - struct packed { - logic q; - logic qe; - } abort; - } pwrmgr_reg2hw_wake_info_reg_t; - - typedef struct packed { - logic d; - logic de; - } pwrmgr_hw2reg_intr_state_reg_t; - - typedef struct packed { - logic d; - } pwrmgr_hw2reg_ctrl_cfg_regwen_reg_t; - - typedef struct packed { - struct packed { - logic d; - logic de; - } low_power_hint; - } pwrmgr_hw2reg_control_reg_t; - - typedef struct packed { - logic d; - logic de; - } pwrmgr_hw2reg_cfg_cdc_sync_reg_t; - - typedef struct packed { - logic d; - logic de; - } pwrmgr_hw2reg_wake_status_mreg_t; - - typedef struct packed { - logic d; - logic de; - } pwrmgr_hw2reg_reset_status_mreg_t; - - typedef struct packed { - struct packed { - logic d; - } reasons; - struct packed { - logic d; - } fall_through; - struct packed { - logic d; - } abort; - } pwrmgr_hw2reg_wake_info_reg_t; - - // Register -> HW type - typedef struct packed { - pwrmgr_reg2hw_intr_state_reg_t intr_state; // [20:20] - pwrmgr_reg2hw_intr_enable_reg_t intr_enable; // [19:19] - pwrmgr_reg2hw_intr_test_reg_t intr_test; // [18:17] - pwrmgr_reg2hw_control_reg_t control; // [16:11] - pwrmgr_reg2hw_cfg_cdc_sync_reg_t cfg_cdc_sync; // [10:9] - pwrmgr_reg2hw_wakeup_en_mreg_t [0:0] wakeup_en; // [8:8] - pwrmgr_reg2hw_reset_en_mreg_t [0:0] reset_en; // [7:7] - pwrmgr_reg2hw_wake_info_capture_dis_reg_t wake_info_capture_dis; // [6:6] - pwrmgr_reg2hw_wake_info_reg_t wake_info; // [5:0] - } pwrmgr_reg2hw_t; - - // HW -> register type - typedef struct packed { - pwrmgr_hw2reg_intr_state_reg_t intr_state; // [13:12] - pwrmgr_hw2reg_ctrl_cfg_regwen_reg_t ctrl_cfg_regwen; // [11:11] - pwrmgr_hw2reg_control_reg_t control; // [10:9] - pwrmgr_hw2reg_cfg_cdc_sync_reg_t cfg_cdc_sync; // [8:7] - pwrmgr_hw2reg_wake_status_mreg_t [0:0] wake_status; // [6:5] - pwrmgr_hw2reg_reset_status_mreg_t [0:0] reset_status; // [4:3] - pwrmgr_hw2reg_wake_info_reg_t wake_info; // [2:0] - } pwrmgr_hw2reg_t; - - // Register offsets - parameter logic [BlockAw-1:0] PWRMGR_INTR_STATE_OFFSET = 6'h 0; - parameter logic [BlockAw-1:0] PWRMGR_INTR_ENABLE_OFFSET = 6'h 4; - parameter logic [BlockAw-1:0] PWRMGR_INTR_TEST_OFFSET = 6'h 8; - parameter logic [BlockAw-1:0] PWRMGR_CTRL_CFG_REGWEN_OFFSET = 6'h c; - parameter logic [BlockAw-1:0] PWRMGR_CONTROL_OFFSET = 6'h 10; - parameter logic [BlockAw-1:0] PWRMGR_CFG_CDC_SYNC_OFFSET = 6'h 14; - parameter logic [BlockAw-1:0] PWRMGR_WAKEUP_EN_REGWEN_OFFSET = 6'h 18; - parameter logic [BlockAw-1:0] PWRMGR_WAKEUP_EN_OFFSET = 6'h 1c; - parameter logic [BlockAw-1:0] PWRMGR_WAKE_STATUS_OFFSET = 6'h 20; - parameter logic [BlockAw-1:0] PWRMGR_RESET_EN_REGWEN_OFFSET = 6'h 24; - parameter logic [BlockAw-1:0] PWRMGR_RESET_EN_OFFSET = 6'h 28; - parameter logic [BlockAw-1:0] PWRMGR_RESET_STATUS_OFFSET = 6'h 2c; - parameter logic [BlockAw-1:0] PWRMGR_WAKE_INFO_CAPTURE_DIS_OFFSET = 6'h 30; - parameter logic [BlockAw-1:0] PWRMGR_WAKE_INFO_OFFSET = 6'h 34; - - // Reset values for hwext registers and their fields - parameter logic [0:0] PWRMGR_INTR_TEST_RESVAL = 1'h 0; - parameter logic [0:0] PWRMGR_INTR_TEST_WAKEUP_RESVAL = 1'h 0; - parameter logic [0:0] PWRMGR_CTRL_CFG_REGWEN_RESVAL = 1'h 1; - parameter logic [0:0] PWRMGR_CTRL_CFG_REGWEN_EN_RESVAL = 1'h 1; - parameter logic [2:0] PWRMGR_WAKE_INFO_RESVAL = 3'h 0; - parameter logic [0:0] PWRMGR_WAKE_INFO_REASONS_RESVAL = 1'h 0; - parameter logic [0:0] PWRMGR_WAKE_INFO_FALL_THROUGH_RESVAL = 1'h 0; - parameter logic [0:0] PWRMGR_WAKE_INFO_ABORT_RESVAL = 1'h 0; - - // Register index - typedef enum int { - PWRMGR_INTR_STATE, - PWRMGR_INTR_ENABLE, - PWRMGR_INTR_TEST, - PWRMGR_CTRL_CFG_REGWEN, - PWRMGR_CONTROL, - PWRMGR_CFG_CDC_SYNC, - PWRMGR_WAKEUP_EN_REGWEN, - PWRMGR_WAKEUP_EN, - PWRMGR_WAKE_STATUS, - PWRMGR_RESET_EN_REGWEN, - PWRMGR_RESET_EN, - PWRMGR_RESET_STATUS, - PWRMGR_WAKE_INFO_CAPTURE_DIS, - PWRMGR_WAKE_INFO - } pwrmgr_id_e; - - // Register width information to check illegal writes - parameter logic [3:0] PWRMGR_PERMIT [14] = '{ - 4'b 0001, // index[ 0] PWRMGR_INTR_STATE - 4'b 0001, // index[ 1] PWRMGR_INTR_ENABLE - 4'b 0001, // index[ 2] PWRMGR_INTR_TEST - 4'b 0001, // index[ 3] PWRMGR_CTRL_CFG_REGWEN - 4'b 0011, // index[ 4] PWRMGR_CONTROL - 4'b 0001, // index[ 5] PWRMGR_CFG_CDC_SYNC - 4'b 0001, // index[ 6] PWRMGR_WAKEUP_EN_REGWEN - 4'b 0001, // index[ 7] PWRMGR_WAKEUP_EN - 4'b 0001, // index[ 8] PWRMGR_WAKE_STATUS - 4'b 0001, // index[ 9] PWRMGR_RESET_EN_REGWEN - 4'b 0001, // index[10] PWRMGR_RESET_EN - 4'b 0001, // index[11] PWRMGR_RESET_STATUS - 4'b 0001, // index[12] PWRMGR_WAKE_INFO_CAPTURE_DIS - 4'b 0001 // index[13] PWRMGR_WAKE_INFO - }; - -endpackage diff --git a/hw/top_earlgrey/dv/chip_sim.core b/hw/top_earlgrey/dv/chip_sim.core index c79fe5592d1a63..c8732a52a3b1c8 100644 --- a/hw/top_earlgrey/dv/chip_sim.core +++ b/hw/top_earlgrey/dv/chip_sim.core @@ -16,6 +16,9 @@ filesets: files_dv: depend: + # Place the autogen packages first to avoid conflicts + - lowrisc:opentitan:top_earlgrey_alert_handler_reg + - lowrisc:opentitan:top_earlgrey_pwrmgr_pkg - lowrisc:ip:tlul - lowrisc:dv:chip_test - lowrisc:dv:clkmgr_sva diff --git a/hw/top_earlgrey/dv/env/chip_env.core b/hw/top_earlgrey/dv/env/chip_env.core index b7cf1059cbd300..a35712a9091a33 100644 --- a/hw/top_earlgrey/dv/env/chip_env.core +++ b/hw/top_earlgrey/dv/env/chip_env.core @@ -31,7 +31,7 @@ filesets: - lowrisc:dv:i2c_agent - lowrisc:dv:pattgen_agent - lowrisc:ip:otp_ctrl_pkg - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:dv:lc_ctrl_dv_utils - "!fileset_partner ? (lowrisc:systems:ast_pkg)" - "fileset_partner ? (partner:systems:ast_pkg)" diff --git a/hw/top_earlgrey/dv/sva/top_earlgrey_sva.core b/hw/top_earlgrey/dv/sva/top_earlgrey_sva.core index d429f609e9db8f..e86c330f155ea1 100644 --- a/hw/top_earlgrey/dv/sva/top_earlgrey_sva.core +++ b/hw/top_earlgrey/dv/sva/top_earlgrey_sva.core @@ -7,7 +7,7 @@ description: "TOP_EARLGREY assertion modules and bind file." filesets: files_dv: depend: - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:prim:assert - lowrisc:systems:top_earlgrey files: diff --git a/hw/top_earlgrey/ip/clkmgr/clkmgr.core b/hw/top_earlgrey/ip/clkmgr/clkmgr.core index b146e9cd3305b3..06422de232a83c 100644 --- a/hw/top_earlgrey/ip/clkmgr/clkmgr.core +++ b/hw/top_earlgrey/ip/clkmgr/clkmgr.core @@ -9,7 +9,7 @@ filesets: files_rtl: depend: - lowrisc:ip:lc_ctrl_pkg - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:tlul - lowrisc:prim:all - lowrisc:prim:buf diff --git a/hw/top_earlgrey/ip/clkmgr/clkmgr_pkg.core b/hw/top_earlgrey/ip/clkmgr/clkmgr_pkg.core index c8c3b25229ae08..c47cf27c055fd5 100644 --- a/hw/top_earlgrey/ip/clkmgr/clkmgr_pkg.core +++ b/hw/top_earlgrey/ip/clkmgr/clkmgr_pkg.core @@ -9,7 +9,7 @@ filesets: files_rtl: depend: - lowrisc:constants:top_pkg - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg files: - rtl/autogen/clkmgr_pkg.sv file_type: systemVerilogSource diff --git a/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl.sv b/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl.sv index 0480c226aa32dc..40ceebad7c36db 100644 --- a/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl.sv +++ b/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl.sv @@ -103,7 +103,6 @@ module flash_ctrl (RdFifoDepth <= MaxFifoDepth)) - import flash_ctrl_reg_pkg::*; import prim_mubi_pkg::mubi4_t; flash_ctrl_core_reg2hw_t reg2hw; diff --git a/hw/top_earlgrey/ip/rstmgr/system_rstmgr_pkg.core b/hw/top_earlgrey/ip/rstmgr/system_rstmgr_pkg.core index aaf4e9d5e052dc..ec08c5d8b2714c 100644 --- a/hw/top_earlgrey/ip/rstmgr/system_rstmgr_pkg.core +++ b/hw/top_earlgrey/ip/rstmgr/system_rstmgr_pkg.core @@ -8,7 +8,7 @@ description: "Auto-generated reset manager package for top_earlgrey" filesets: files_rtl: depend: - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:ip:rstmgr_reg - lowrisc:ip_interfaces:alert_handler_reg - lowrisc:ip:alert_handler_component diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/dv/env/pwrmgr_env.core b/hw/top_earlgrey/ip_autogen/pwrmgr/dv/env/pwrmgr_env.core index d71a35180c2772..b19f07c3623908 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/dv/env/pwrmgr_env.core +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/dv/env/pwrmgr_env.core @@ -9,7 +9,7 @@ filesets: depend: - lowrisc:dv:ralgen - lowrisc:dv:cip_lib - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg files: - pwrmgr_env_pkg.sv - pwrmgr_env_cfg.sv: {is_include_file: true} diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core b/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core index 79631950495e26..8adac26d23551f 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_rstmgr_sva_if.core @@ -7,7 +7,7 @@ description: "PWRMGR to RSTMGR assertion interface." filesets: files_dv: depend: - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:prim:assert files: - pwrmgr_rstmgr_sva_if.sv diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_sva.core b/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_sva.core index b71c2dede28a47..99665f575a8a31 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_sva.core +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/dv/sva/pwrmgr_sva.core @@ -9,7 +9,7 @@ filesets: depend: - lowrisc:tlul:headers - lowrisc:fpv:csr_assert_gen - - lowrisc:ip:pwrmgr_pkg + - lowrisc:ip_interfaces:pwrmgr_pkg - lowrisc:dv:clkmgr_pwrmgr_sva_if - lowrisc:dv:pwrmgr_rstmgr_sva_if files: diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr.core b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr.core index c384dae955aaba..a12e1d70b13931 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr.core +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr.core @@ -2,32 +2,17 @@ CAPI=2: # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -name: "lowrisc:ip:pwrmgr:0.1" +name: lowrisc:opentitan:top_earlgrey_pwrmgr:0.1 description: "Power manager RTL" +virtual: + - lowrisc:ip_interfaces:pwrmgr filesets: files_rtl: depend: - - lowrisc:ip:tlul - - lowrisc:prim:esc - - lowrisc:prim:lc_sync - - lowrisc:prim:lc_sender - - lowrisc:prim:all - - lowrisc:ip:rom_ctrl_pkg - - lowrisc:ip:lc_ctrl_pkg - - lowrisc:prim:sparse_fsm - - lowrisc:prim:mubi - - lowrisc:prim:clock_buf - - lowrisc:prim:measure - - lowrisc:ip_interfaces:alert_handler_reg - - lowrisc:ip:pwrmgr_pkg - - lowrisc:ip:pwrmgr_reg - files: - - rtl/pwrmgr_cdc.sv - - rtl/pwrmgr_slow_fsm.sv - - rtl/pwrmgr_fsm.sv - - rtl/pwrmgr_wake_info.sv - - rtl/pwrmgr.sv + - lowrisc:opentitan:top_earlgrey_pwrmgr_pkg:0.1 + - lowrisc:opentitan:top_earlgrey_pwrmgr_reg:0.1 + - lowrisc:ip:pwrmgr_component file_type: systemVerilogSource files_verilator_waiver: diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_components.core b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_components.core new file mode 100644 index 00000000000000..2069107cadb6b0 --- /dev/null +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_components.core @@ -0,0 +1,80 @@ +CAPI=2: +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 +name: "lowrisc:ip:pwrmgr_component:0.1" +description: "Power manager RTL" + +filesets: + files_rtl: + depend: + - lowrisc:ip:tlul + - lowrisc:prim:esc + - lowrisc:prim:lc_sync + - lowrisc:prim:lc_sender + - lowrisc:prim:all + - lowrisc:ip:rom_ctrl_pkg + - lowrisc:ip:lc_ctrl_pkg + - lowrisc:prim:sparse_fsm + - lowrisc:prim:mubi + - lowrisc:prim:clock_buf + - lowrisc:prim:measure + - lowrisc:ip_interfaces:alert_handler_reg + - lowrisc:ip_interfaces:pwrmgr_pkg + files: + - rtl/pwrmgr_cdc.sv + - rtl/pwrmgr_slow_fsm.sv + - rtl/pwrmgr_fsm.sv + - rtl/pwrmgr_wake_info.sv + - rtl/pwrmgr.sv + file_type: systemVerilogSource + + files_verilator_waiver: + depend: + # common waivers + - lowrisc:lint:common + - lowrisc:lint:comportable + files: + - lint/pwrmgr.vlt + file_type: vlt + + files_ascentlint_waiver: + depend: + # common waivers + - lowrisc:lint:common + - lowrisc:lint:comportable + files: + - lint/pwrmgr.waiver + file_type: waiver + + files_veriblelint_waiver: + depend: + # common waivers + - lowrisc:lint:common + - lowrisc:lint:comportable + +parameters: + SYNTHESIS: + datatype: bool + paramtype: vlogdefine + + +targets: + default: &default_target + filesets: + - tool_verilator ? (files_verilator_waiver) + - tool_ascentlint ? (files_ascentlint_waiver) + - tool_veriblelint ? (files_veriblelint_waiver) + - files_rtl + toplevel: pwrmgr + + lint: + <<: *default_target + default_tool: verilator + parameters: + - SYNTHESIS=true + tools: + verilator: + mode: lint-only + verilator_options: + - "-Wall" diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_pkg.core b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_pkg.core index 3e83cde44fd128..71d3abdcafc86f 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_pkg.core +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_pkg.core @@ -2,13 +2,15 @@ CAPI=2: # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -name: "lowrisc:ip:pwrmgr_pkg:0.1" +name: lowrisc:opentitan:top_earlgrey_pwrmgr_pkg:0.1 description: "Power manager package" +virtual: + - lowrisc:ip_interfaces:pwrmgr_pkg filesets: files_rtl: depend: - - lowrisc:ip:pwrmgr_reg + - lowrisc:opentitan:top_earlgrey_pwrmgr_reg files: - rtl/pwrmgr_pkg.sv file_type: systemVerilogSource diff --git a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_reg.core b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_reg.core index c20cd917273d83..75361f737b0b80 100644 --- a/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_reg.core +++ b/hw/top_earlgrey/ip_autogen/pwrmgr/pwrmgr_reg.core @@ -2,8 +2,10 @@ CAPI=2: # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -name: "lowrisc:ip:pwrmgr_reg:0.1" +name: lowrisc:opentitan:top_earlgrey_pwrmgr_reg:0.1 description: "Power manager registers" +virtual: + - lowrisc:ip_interfaces:pwrmgr_reg filesets: files_rtl: diff --git a/hw/top_earlgrey/top_earlgrey.core b/hw/top_earlgrey/top_earlgrey.core index e2e3536fcfaac4..4dd99a51b247c3 100644 --- a/hw/top_earlgrey/top_earlgrey.core +++ b/hw/top_earlgrey/top_earlgrey.core @@ -7,6 +7,9 @@ description: "Technology-independent Earl Grey toplevel" filesets: files_rtl_generic: depend: + # Place the autogen packages first to avoid conflicts + - lowrisc:opentitan:top_earlgrey_alert_handler_reg + - lowrisc:opentitan:top_earlgrey_pwrmgr_pkg - lowrisc:ip:uart:0.1 - lowrisc:opentitan:top_earlgrey_alert_handler - lowrisc:ip:gpio @@ -41,7 +44,7 @@ filesets: - lowrisc:top_earlgrey:xbar_main - lowrisc:top_earlgrey:xbar_peri - lowrisc:ip:rstmgr - - lowrisc:ip:pwrmgr + - lowrisc:opentitan:top_earlgrey_pwrmgr - lowrisc:ip:aon_timer - lowrisc:ip:adc_ctrl - lowrisc:ip:sysrst_ctrl diff --git a/hw/top_englishbreakfast/top_englishbreakfast.core b/hw/top_englishbreakfast/top_englishbreakfast.core index 981cc42037b68d..6d7dfc1fb1233f 100644 --- a/hw/top_englishbreakfast/top_englishbreakfast.core +++ b/hw/top_englishbreakfast/top_englishbreakfast.core @@ -39,7 +39,7 @@ filesets: - lowrisc:top_englishbreakfast:xbar_main - lowrisc:top_englishbreakfast:xbar_peri - lowrisc:ip:rstmgr - - lowrisc:ip:pwrmgr + - lowrisc:ip_interfaces:pwrmgr - lowrisc:ip:rom_ctrl - lowrisc:ip:aon_timer diff --git a/util/topgen-fusesoc.py b/util/topgen-fusesoc.py index 61114341d8104e..a74482c973ec3d 100755 --- a/util/topgen-fusesoc.py +++ b/util/topgen-fusesoc.py @@ -125,7 +125,7 @@ def main(): 'lowrisc:constants:top_pkg', 'lowrisc:prim:util', 'lowrisc:ip:lc_ctrl_pkg', - 'lowrisc:ip:pwrmgr_pkg', + 'lowrisc:ip_interfaces:pwrmgr_pkg', # rstmgr 'lowrisc:prim:clock_mux2', # clkmgr