lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | // Copyright lowRISC contributors. |
| 2 | // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
Michael Schaffner | 40b6bd2 | 2020-10-27 19:52:23 -0700 | [diff] [blame] | 4 | // |
| 5 | // ------------------- W A R N I N G: A U T O - G E N E R A T E D C O D E !! -------------------// |
| 6 | // PLEASE DO NOT HAND-EDIT THIS FILE. IT HAS BEEN AUTO-GENERATED WITH THE FOLLOWING COMMAND: |
| 7 | // |
| 8 | // util/topgen.py -t hw/top_earlgrey/data/top_earlgrey.hjson \ |
| 9 | // --tpl hw/top_earlgrey/data/ \ |
| 10 | // -o hw/top_earlgrey/ \ |
| 11 | // --rnd_cnst_seed 4881560218908238235 |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 12 | |
Timothy Chen | 7ff5312 | 2019-09-19 15:20:43 -0700 | [diff] [blame] | 13 | module top_earlgrey #( |
Pirmin Vogel | 15e1b91 | 2020-09-16 14:43:22 +0200 | [diff] [blame] | 14 | // Auto-inferred parameters |
Timothy Chen | 20ae79e | 2020-11-03 16:25:03 -0800 | [diff] [blame] | 15 | parameter bit AesMasking = 1'b1, |
Pirmin Vogel | e6ca872 | 2021-01-31 11:36:47 +0100 | [diff] [blame] | 16 | parameter aes_pkg::sbox_impl_e AesSBoxImpl = aes_pkg::SBoxImplDom, |
Pirmin Vogel | 15e1b91 | 2020-09-16 14:43:22 +0200 | [diff] [blame] | 17 | parameter int unsigned SecAesStartTriggerDelay = 0, |
Pirmin Vogel | 4429c36 | 2020-10-02 17:54:11 +0200 | [diff] [blame] | 18 | parameter bit SecAesAllowForcingMasks = 1'b0, |
Eunchan Kim | f7ed184 | 2020-12-29 12:59:39 -0800 | [diff] [blame] | 19 | parameter bit KmacEnMasking = 0, |
Eunchan Kim | e5d33b7 | 2020-11-03 14:34:16 -0800 | [diff] [blame] | 20 | parameter int KmacReuseShare = 0, |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 21 | parameter aes_pkg::sbox_impl_e CsrngSBoxImpl = aes_pkg::SBoxImplLut, |
Pirmin Vogel | 69b55a8 | 2020-10-01 09:54:39 +0200 | [diff] [blame] | 22 | parameter otbn_pkg::regfile_e OtbnRegFile = otbn_pkg::RegFileFF, |
Pirmin Vogel | 15e1b91 | 2020-09-16 14:43:22 +0200 | [diff] [blame] | 23 | |
| 24 | // Manually defined parameters |
Pirmin Vogel | 4eb2502 | 2020-08-27 15:27:33 +0200 | [diff] [blame] | 25 | parameter ibex_pkg::regfile_e IbexRegFile = ibex_pkg::RegFileFF, |
Tom Roberts | 7824ccc | 2020-11-05 11:34:03 +0000 | [diff] [blame] | 26 | parameter bit IbexICache = 1, |
Philipp Wagner | a37bcfa | 2020-05-19 22:46:41 +0100 | [diff] [blame] | 27 | parameter bit IbexPipeLine = 0, |
| 28 | parameter BootRomInitFile = "" |
Timothy Chen | 7ff5312 | 2019-09-19 15:20:43 -0700 | [diff] [blame] | 29 | ) ( |
Timothy Chen | 371c94d | 2020-06-30 17:18:14 -0700 | [diff] [blame] | 30 | // Reset, clocks defined as part of intermodule |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 31 | input rst_ni, |
| 32 | |
| 33 | // JTAG interface |
| 34 | input jtag_tck_i, |
| 35 | input jtag_tms_i, |
| 36 | input jtag_trst_ni, |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 37 | input jtag_tdi_i, |
| 38 | output jtag_tdo_o, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 39 | |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 40 | // Multiplexed I/O |
| 41 | input [31:0] mio_in_i, |
| 42 | output logic [31:0] mio_out_o, |
| 43 | output logic [31:0] mio_oe_o, |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 44 | // Dedicated I/O |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 45 | input [14:0] dio_in_i, |
| 46 | output logic [14:0] dio_out_o, |
| 47 | output logic [14:0] dio_oe_o, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 48 | |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 49 | // pad attributes to padring |
| 50 | output logic[padctrl_reg_pkg::NMioPads-1:0] |
| 51 | [padctrl_reg_pkg::AttrDw-1:0] mio_attr_o, |
| 52 | output logic[padctrl_reg_pkg::NDioPads-1:0] |
| 53 | [padctrl_reg_pkg::AttrDw-1:0] dio_attr_o, |
| 54 | |
Timothy Chen | 371c94d | 2020-06-30 17:18:14 -0700 | [diff] [blame] | 55 | |
| 56 | // Inter-module Signal External type |
Eunchan Kim | 5511bbe | 2020-08-07 14:04:20 -0700 | [diff] [blame] | 57 | input logic clk_main_i, |
| 58 | input logic clk_io_i, |
| 59 | input logic clk_usb_i, |
| 60 | input logic clk_aon_i, |
Timothy Chen | 437fd9a | 2020-08-26 12:48:40 -0700 | [diff] [blame] | 61 | input rstmgr_pkg::rstmgr_ast_t rstmgr_ast_i, |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 62 | output pwrmgr_pkg::pwr_ast_req_t pwrmgr_ast_req_o, |
| 63 | input pwrmgr_pkg::pwr_ast_rsp_t pwrmgr_ast_rsp_i, |
Timothy Chen | 1555dce | 2020-08-11 11:26:50 -0700 | [diff] [blame] | 64 | input ast_wrapper_pkg::ast_alert_req_t sensor_ctrl_ast_alert_req_i, |
| 65 | output ast_wrapper_pkg::ast_alert_rsp_t sensor_ctrl_ast_alert_rsp_o, |
| 66 | input ast_wrapper_pkg::ast_status_t sensor_ctrl_ast_status_i, |
| 67 | output logic usbdev_usb_ref_val_o, |
| 68 | output logic usbdev_usb_ref_pulse_o, |
Timothy Chen | fb34fe3 | 2020-08-26 17:13:19 -0700 | [diff] [blame] | 69 | output tlul_pkg::tl_h2d_t ast_tl_req_o, |
| 70 | input tlul_pkg::tl_d2h_t ast_tl_rsp_i, |
Michael Schaffner | a304560 | 2020-10-06 19:19:46 -0700 | [diff] [blame] | 71 | output otp_ctrl_pkg::otp_ast_req_t otp_ctrl_otp_ast_pwr_seq_o, |
| 72 | input otp_ctrl_pkg::otp_ast_rsp_t otp_ctrl_otp_ast_pwr_seq_h_i, |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 73 | input lc_ctrl_pkg::lc_tx_t flash_bist_enable_i, |
Timothy Chen | 2422a6c | 2020-11-19 16:06:14 -0800 | [diff] [blame] | 74 | input logic flash_power_down_h_i, |
| 75 | input logic flash_power_ready_h_i, |
Michael Schaffner | 9c3d6a8 | 2021-02-02 17:05:31 -0800 | [diff] [blame] | 76 | input logic [3:0] flash_test_mode_a_i, |
Timothy Chen | 2422a6c | 2020-11-19 16:06:14 -0800 | [diff] [blame] | 77 | input logic flash_test_voltage_h_i, |
Timothy Chen | 075ed37 | 2021-02-04 14:42:29 -0800 | [diff] [blame^] | 78 | input edn_pkg::edn_req_t ast_edn_edn_req_i, |
| 79 | output edn_pkg::edn_rsp_t ast_edn_edn_rsp_o, |
Timothy Chen | 437fd9a | 2020-08-26 12:48:40 -0700 | [diff] [blame] | 80 | output clkmgr_pkg::clkmgr_ast_out_t clks_ast_o, |
| 81 | output rstmgr_pkg::rstmgr_ast_out_t rsts_ast_o, |
Timothy Chen | ac3a8c9 | 2020-06-29 20:17:07 -0700 | [diff] [blame] | 82 | input scan_rst_ni, // reset used for test mode |
Timothy Chen | 010e3cc | 2021-02-02 14:55:09 -0800 | [diff] [blame] | 83 | input scan_en_i, |
Timothy Chen | ac3a8c9 | 2020-06-29 20:17:07 -0700 | [diff] [blame] | 84 | input scanmode_i // 1 for Scan |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 85 | ); |
| 86 | |
Philipp Wagner | 086b703 | 2019-10-25 17:06:15 +0100 | [diff] [blame] | 87 | // JTAG IDCODE for development versions of this code. |
| 88 | // Manufacturers of OpenTitan chips must replace this code with one of their |
| 89 | // own IDs. |
| 90 | // Field structure as defined in the IEEE 1149.1 (JTAG) specification, |
| 91 | // section 12.1.1. |
Michael Schaffner | d4d5d2f | 2020-04-17 15:45:55 -0700 | [diff] [blame] | 92 | localparam logic [31:0] JTAG_IDCODE = { |
Philipp Wagner | 086b703 | 2019-10-25 17:06:15 +0100 | [diff] [blame] | 93 | 4'h0, // Version |
| 94 | 16'h4F54, // Part Number: "OT" |
Philipp Wagner | f57964e | 2019-11-04 17:57:06 +0000 | [diff] [blame] | 95 | 11'h426, // Manufacturer Identity: Google |
Philipp Wagner | 086b703 | 2019-10-25 17:06:15 +0100 | [diff] [blame] | 96 | 1'b1 // (fixed) |
| 97 | }; |
| 98 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 99 | import tlul_pkg::*; |
| 100 | import top_pkg::*; |
| 101 | import tl_main_pkg::*; |
Michael Schaffner | 40b6bd2 | 2020-10-27 19:52:23 -0700 | [diff] [blame] | 102 | // Compile-time random constants |
| 103 | import top_earlgrey_rnd_cnst_pkg::*; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 104 | |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 105 | // Signals |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 106 | logic [40:0] mio_p2d; |
| 107 | logic [44:0] mio_d2p; |
| 108 | logic [44:0] mio_d2p_en; |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 109 | logic [14:0] dio_p2d; |
| 110 | logic [14:0] dio_d2p; |
| 111 | logic [14:0] dio_d2p_en; |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 112 | // uart0 |
| 113 | logic cio_uart0_rx_p2d; |
| 114 | logic cio_uart0_tx_d2p; |
| 115 | logic cio_uart0_tx_en_d2p; |
| 116 | // uart1 |
| 117 | logic cio_uart1_rx_p2d; |
| 118 | logic cio_uart1_tx_d2p; |
| 119 | logic cio_uart1_tx_en_d2p; |
| 120 | // uart2 |
| 121 | logic cio_uart2_rx_p2d; |
| 122 | logic cio_uart2_tx_d2p; |
| 123 | logic cio_uart2_tx_en_d2p; |
| 124 | // uart3 |
| 125 | logic cio_uart3_rx_p2d; |
| 126 | logic cio_uart3_tx_d2p; |
| 127 | logic cio_uart3_tx_en_d2p; |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 128 | // gpio |
| 129 | logic [31:0] cio_gpio_gpio_p2d; |
| 130 | logic [31:0] cio_gpio_gpio_d2p; |
| 131 | logic [31:0] cio_gpio_gpio_en_d2p; |
| 132 | // spi_device |
| 133 | logic cio_spi_device_sck_p2d; |
| 134 | logic cio_spi_device_csb_p2d; |
Scott Johnson | fe79c4b | 2020-07-08 10:31:08 -0700 | [diff] [blame] | 135 | logic cio_spi_device_sdi_p2d; |
| 136 | logic cio_spi_device_sdo_d2p; |
| 137 | logic cio_spi_device_sdo_en_d2p; |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 138 | // i2c0 |
| 139 | logic cio_i2c0_sda_p2d; |
| 140 | logic cio_i2c0_scl_p2d; |
| 141 | logic cio_i2c0_sda_d2p; |
| 142 | logic cio_i2c0_sda_en_d2p; |
| 143 | logic cio_i2c0_scl_d2p; |
| 144 | logic cio_i2c0_scl_en_d2p; |
| 145 | // i2c1 |
| 146 | logic cio_i2c1_sda_p2d; |
| 147 | logic cio_i2c1_scl_p2d; |
| 148 | logic cio_i2c1_sda_d2p; |
| 149 | logic cio_i2c1_sda_en_d2p; |
| 150 | logic cio_i2c1_scl_d2p; |
| 151 | logic cio_i2c1_scl_en_d2p; |
| 152 | // i2c2 |
| 153 | logic cio_i2c2_sda_p2d; |
| 154 | logic cio_i2c2_scl_p2d; |
| 155 | logic cio_i2c2_sda_d2p; |
| 156 | logic cio_i2c2_sda_en_d2p; |
| 157 | logic cio_i2c2_scl_d2p; |
| 158 | logic cio_i2c2_scl_en_d2p; |
| 159 | // pattgen |
| 160 | logic cio_pattgen_pda0_tx_d2p; |
| 161 | logic cio_pattgen_pda0_tx_en_d2p; |
| 162 | logic cio_pattgen_pcl0_tx_d2p; |
| 163 | logic cio_pattgen_pcl0_tx_en_d2p; |
| 164 | logic cio_pattgen_pda1_tx_d2p; |
| 165 | logic cio_pattgen_pda1_tx_en_d2p; |
| 166 | logic cio_pattgen_pcl1_tx_d2p; |
| 167 | logic cio_pattgen_pcl1_tx_en_d2p; |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 168 | // rv_timer |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 169 | // usbdev |
| 170 | logic cio_usbdev_sense_p2d; |
Pirmin Vogel | b054fc0 | 2020-03-11 11:23:03 +0100 | [diff] [blame] | 171 | logic cio_usbdev_d_p2d; |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 172 | logic cio_usbdev_dp_p2d; |
| 173 | logic cio_usbdev_dn_p2d; |
Pirmin Vogel | b054fc0 | 2020-03-11 11:23:03 +0100 | [diff] [blame] | 174 | logic cio_usbdev_se0_d2p; |
| 175 | logic cio_usbdev_se0_en_d2p; |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 176 | logic cio_usbdev_dp_pullup_d2p; |
| 177 | logic cio_usbdev_dp_pullup_en_d2p; |
| 178 | logic cio_usbdev_dn_pullup_d2p; |
| 179 | logic cio_usbdev_dn_pullup_en_d2p; |
Pirmin Vogel | b054fc0 | 2020-03-11 11:23:03 +0100 | [diff] [blame] | 180 | logic cio_usbdev_tx_mode_se_d2p; |
| 181 | logic cio_usbdev_tx_mode_se_en_d2p; |
| 182 | logic cio_usbdev_suspend_d2p; |
| 183 | logic cio_usbdev_suspend_en_d2p; |
| 184 | logic cio_usbdev_d_d2p; |
| 185 | logic cio_usbdev_d_en_d2p; |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 186 | logic cio_usbdev_dp_d2p; |
| 187 | logic cio_usbdev_dp_en_d2p; |
| 188 | logic cio_usbdev_dn_d2p; |
| 189 | logic cio_usbdev_dn_en_d2p; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 190 | // otp_ctrl |
| 191 | // lc_ctrl |
| 192 | // alert_handler |
| 193 | // nmi_gen |
| 194 | // pwrmgr_aon |
| 195 | // rstmgr_aon |
| 196 | // clkmgr_aon |
| 197 | // pinmux_aon |
| 198 | // padctrl_aon |
| 199 | // sensor_ctrl_aon |
| 200 | // sram_ctrl_ret_aon |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 201 | // flash_ctrl |
| 202 | // rv_plic |
| 203 | // aes |
| 204 | // hmac |
| 205 | // kmac |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 206 | // keymgr |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 207 | // csrng |
| 208 | // entropy_src |
| 209 | // edn0 |
| 210 | // edn1 |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 211 | // sram_ctrl_main |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 212 | // otbn |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 213 | |
| 214 | |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 215 | logic [171:0] intr_vector; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 216 | // Interrupt source list |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 217 | logic intr_uart0_tx_watermark; |
| 218 | logic intr_uart0_rx_watermark; |
| 219 | logic intr_uart0_tx_empty; |
| 220 | logic intr_uart0_rx_overflow; |
| 221 | logic intr_uart0_rx_frame_err; |
| 222 | logic intr_uart0_rx_break_err; |
| 223 | logic intr_uart0_rx_timeout; |
| 224 | logic intr_uart0_rx_parity_err; |
| 225 | logic intr_uart1_tx_watermark; |
| 226 | logic intr_uart1_rx_watermark; |
| 227 | logic intr_uart1_tx_empty; |
| 228 | logic intr_uart1_rx_overflow; |
| 229 | logic intr_uart1_rx_frame_err; |
| 230 | logic intr_uart1_rx_break_err; |
| 231 | logic intr_uart1_rx_timeout; |
| 232 | logic intr_uart1_rx_parity_err; |
| 233 | logic intr_uart2_tx_watermark; |
| 234 | logic intr_uart2_rx_watermark; |
| 235 | logic intr_uart2_tx_empty; |
| 236 | logic intr_uart2_rx_overflow; |
| 237 | logic intr_uart2_rx_frame_err; |
| 238 | logic intr_uart2_rx_break_err; |
| 239 | logic intr_uart2_rx_timeout; |
| 240 | logic intr_uart2_rx_parity_err; |
| 241 | logic intr_uart3_tx_watermark; |
| 242 | logic intr_uart3_rx_watermark; |
| 243 | logic intr_uart3_tx_empty; |
| 244 | logic intr_uart3_rx_overflow; |
| 245 | logic intr_uart3_rx_frame_err; |
| 246 | logic intr_uart3_rx_break_err; |
| 247 | logic intr_uart3_rx_timeout; |
| 248 | logic intr_uart3_rx_parity_err; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 249 | logic [31:0] intr_gpio_gpio; |
Eunchan Kim | 8c57fe3 | 2019-09-02 21:14:24 -0700 | [diff] [blame] | 250 | logic intr_spi_device_rxf; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 251 | logic intr_spi_device_rxlvl; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 252 | logic intr_spi_device_txlvl; |
| 253 | logic intr_spi_device_rxerr; |
Eunchan Kim | 546c0d4 | 2019-09-24 15:07:06 -0700 | [diff] [blame] | 254 | logic intr_spi_device_rxoverflow; |
| 255 | logic intr_spi_device_txunderflow; |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 256 | logic intr_i2c0_fmt_watermark; |
| 257 | logic intr_i2c0_rx_watermark; |
| 258 | logic intr_i2c0_fmt_overflow; |
| 259 | logic intr_i2c0_rx_overflow; |
| 260 | logic intr_i2c0_nak; |
| 261 | logic intr_i2c0_scl_interference; |
| 262 | logic intr_i2c0_sda_interference; |
| 263 | logic intr_i2c0_stretch_timeout; |
| 264 | logic intr_i2c0_sda_unstable; |
| 265 | logic intr_i2c0_trans_complete; |
| 266 | logic intr_i2c0_tx_empty; |
| 267 | logic intr_i2c0_tx_nonempty; |
| 268 | logic intr_i2c0_tx_overflow; |
| 269 | logic intr_i2c0_acq_overflow; |
| 270 | logic intr_i2c0_ack_stop; |
| 271 | logic intr_i2c0_host_timeout; |
| 272 | logic intr_i2c1_fmt_watermark; |
| 273 | logic intr_i2c1_rx_watermark; |
| 274 | logic intr_i2c1_fmt_overflow; |
| 275 | logic intr_i2c1_rx_overflow; |
| 276 | logic intr_i2c1_nak; |
| 277 | logic intr_i2c1_scl_interference; |
| 278 | logic intr_i2c1_sda_interference; |
| 279 | logic intr_i2c1_stretch_timeout; |
| 280 | logic intr_i2c1_sda_unstable; |
| 281 | logic intr_i2c1_trans_complete; |
| 282 | logic intr_i2c1_tx_empty; |
| 283 | logic intr_i2c1_tx_nonempty; |
| 284 | logic intr_i2c1_tx_overflow; |
| 285 | logic intr_i2c1_acq_overflow; |
| 286 | logic intr_i2c1_ack_stop; |
| 287 | logic intr_i2c1_host_timeout; |
| 288 | logic intr_i2c2_fmt_watermark; |
| 289 | logic intr_i2c2_rx_watermark; |
| 290 | logic intr_i2c2_fmt_overflow; |
| 291 | logic intr_i2c2_rx_overflow; |
| 292 | logic intr_i2c2_nak; |
| 293 | logic intr_i2c2_scl_interference; |
| 294 | logic intr_i2c2_sda_interference; |
| 295 | logic intr_i2c2_stretch_timeout; |
| 296 | logic intr_i2c2_sda_unstable; |
| 297 | logic intr_i2c2_trans_complete; |
| 298 | logic intr_i2c2_tx_empty; |
| 299 | logic intr_i2c2_tx_nonempty; |
| 300 | logic intr_i2c2_tx_overflow; |
| 301 | logic intr_i2c2_acq_overflow; |
| 302 | logic intr_i2c2_ack_stop; |
| 303 | logic intr_i2c2_host_timeout; |
| 304 | logic intr_pattgen_done_ch0; |
| 305 | logic intr_pattgen_done_ch1; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 306 | logic intr_rv_timer_timer_expired_0_0; |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 307 | logic intr_usbdev_pkt_received; |
| 308 | logic intr_usbdev_pkt_sent; |
| 309 | logic intr_usbdev_disconnected; |
| 310 | logic intr_usbdev_host_lost; |
| 311 | logic intr_usbdev_link_reset; |
| 312 | logic intr_usbdev_link_suspend; |
| 313 | logic intr_usbdev_link_resume; |
| 314 | logic intr_usbdev_av_empty; |
| 315 | logic intr_usbdev_rx_full; |
| 316 | logic intr_usbdev_av_overflow; |
| 317 | logic intr_usbdev_link_in_err; |
| 318 | logic intr_usbdev_rx_crc_err; |
| 319 | logic intr_usbdev_rx_pid_err; |
| 320 | logic intr_usbdev_rx_bitstuff_err; |
| 321 | logic intr_usbdev_frame; |
| 322 | logic intr_usbdev_connected; |
Stefan Lippuner | 207b1a6 | 2020-11-10 09:25:53 +0100 | [diff] [blame] | 323 | logic intr_usbdev_link_out_err; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 324 | logic intr_otp_ctrl_otp_operation_done; |
| 325 | logic intr_otp_ctrl_otp_error; |
| 326 | logic intr_alert_handler_classa; |
| 327 | logic intr_alert_handler_classb; |
| 328 | logic intr_alert_handler_classc; |
| 329 | logic intr_alert_handler_classd; |
| 330 | logic intr_nmi_gen_esc0; |
| 331 | logic intr_nmi_gen_esc1; |
| 332 | logic intr_nmi_gen_esc2; |
| 333 | logic intr_pwrmgr_aon_wakeup; |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 334 | logic intr_flash_ctrl_prog_empty; |
| 335 | logic intr_flash_ctrl_prog_lvl; |
| 336 | logic intr_flash_ctrl_rd_full; |
| 337 | logic intr_flash_ctrl_rd_lvl; |
| 338 | logic intr_flash_ctrl_op_done; |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 339 | logic intr_hmac_hmac_done; |
| 340 | logic intr_hmac_fifo_empty; |
| 341 | logic intr_hmac_hmac_err; |
| 342 | logic intr_kmac_kmac_done; |
| 343 | logic intr_kmac_fifo_empty; |
| 344 | logic intr_kmac_kmac_err; |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 345 | logic intr_keymgr_op_done; |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 346 | logic intr_csrng_cs_cmd_req_done; |
| 347 | logic intr_csrng_cs_entropy_req; |
| 348 | logic intr_csrng_cs_hw_inst_exc; |
| 349 | logic intr_csrng_cs_fifo_err; |
| 350 | logic intr_entropy_src_es_entropy_valid; |
| 351 | logic intr_entropy_src_es_health_test_failed; |
| 352 | logic intr_entropy_src_es_fifo_err; |
| 353 | logic intr_edn0_edn_cmd_req_done; |
| 354 | logic intr_edn0_edn_fifo_err; |
| 355 | logic intr_edn1_edn_cmd_req_done; |
| 356 | logic intr_edn1_edn_fifo_err; |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 357 | logic intr_otbn_done; |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 358 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 359 | |
Michael Schaffner | d4d5d2f | 2020-04-17 15:45:55 -0700 | [diff] [blame] | 360 | |
Michael Schaffner | 1ba89b8 | 2019-11-03 14:25:54 -0800 | [diff] [blame] | 361 | logic [0:0] irq_plic; |
| 362 | logic [0:0] msip; |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 363 | logic [7:0] irq_id[1]; |
| 364 | logic [7:0] unused_irq_id[1]; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 365 | |
Michael Schaffner | 1ba89b8 | 2019-11-03 14:25:54 -0800 | [diff] [blame] | 366 | // this avoids lint errors |
| 367 | assign unused_irq_id = irq_id; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 368 | |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 369 | // Alert list |
Philipp Wagner | 79725e1 | 2020-03-03 23:34:38 +0000 | [diff] [blame] | 370 | prim_alert_pkg::alert_tx_t [alert_pkg::NAlerts-1:0] alert_tx; |
| 371 | prim_alert_pkg::alert_rx_t [alert_pkg::NAlerts-1:0] alert_rx; |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 372 | |
| 373 | |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 374 | // define inter-module signals |
Timothy Chen | ccf343d | 2020-12-04 20:38:15 -0800 | [diff] [blame] | 375 | alert_pkg::alert_crashdump_t alert_handler_crashdump; |
Timothy Chen | c0d32d9 | 2020-12-16 18:01:22 -0800 | [diff] [blame] | 376 | prim_esc_pkg::esc_rx_t [3:0] alert_handler_esc_rx; |
| 377 | prim_esc_pkg::esc_tx_t [3:0] alert_handler_esc_tx; |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 378 | csrng_pkg::csrng_req_t [1:0] csrng_csrng_cmd_req; |
| 379 | csrng_pkg::csrng_rsp_t [1:0] csrng_csrng_cmd_rsp; |
Timothy Chen | ccf343d | 2020-12-04 20:38:15 -0800 | [diff] [blame] | 380 | entropy_src_pkg::entropy_src_hw_if_req_t csrng_entropy_src_hw_if_req; |
| 381 | entropy_src_pkg::entropy_src_hw_if_rsp_t csrng_entropy_src_hw_if_rsp; |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 382 | flash_ctrl_pkg::flash_req_t flash_ctrl_flash_req; |
| 383 | flash_ctrl_pkg::flash_rsp_t flash_ctrl_flash_rsp; |
Timothy Chen | ccf343d | 2020-12-04 20:38:15 -0800 | [diff] [blame] | 384 | flash_ctrl_pkg::keymgr_flash_t flash_ctrl_keymgr; |
| 385 | otp_ctrl_pkg::flash_otp_key_req_t flash_ctrl_otp_req; |
| 386 | otp_ctrl_pkg::flash_otp_key_rsp_t flash_ctrl_otp_rsp; |
Timothy Chen | 3cb138f | 2020-12-15 20:35:03 -0800 | [diff] [blame] | 387 | lc_ctrl_pkg::lc_tx_t flash_ctrl_rma_req; |
| 388 | lc_ctrl_pkg::lc_tx_t flash_ctrl_rma_ack; |
| 389 | lc_ctrl_pkg::lc_flash_rma_seed_t flash_ctrl_rma_seed; |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 390 | sram_ctrl_pkg::sram_scr_req_t sram_ctrl_main_sram_scr_req; |
| 391 | sram_ctrl_pkg::sram_scr_rsp_t sram_ctrl_main_sram_scr_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 392 | sram_ctrl_pkg::sram_scr_req_t sram_ctrl_ret_aon_sram_scr_req; |
| 393 | sram_ctrl_pkg::sram_scr_rsp_t sram_ctrl_ret_aon_sram_scr_rsp; |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 394 | otp_ctrl_pkg::sram_otp_key_req_t [1:0] otp_ctrl_sram_otp_key_req; |
| 395 | otp_ctrl_pkg::sram_otp_key_rsp_t [1:0] otp_ctrl_sram_otp_key_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 396 | pwrmgr_pkg::pwr_flash_req_t pwrmgr_aon_pwr_flash_req; |
| 397 | pwrmgr_pkg::pwr_flash_rsp_t pwrmgr_aon_pwr_flash_rsp; |
| 398 | pwrmgr_pkg::pwr_rst_req_t pwrmgr_aon_pwr_rst_req; |
| 399 | pwrmgr_pkg::pwr_rst_rsp_t pwrmgr_aon_pwr_rst_rsp; |
| 400 | pwrmgr_pkg::pwr_clk_req_t pwrmgr_aon_pwr_clk_req; |
| 401 | pwrmgr_pkg::pwr_clk_rsp_t pwrmgr_aon_pwr_clk_rsp; |
| 402 | pwrmgr_pkg::pwr_otp_req_t pwrmgr_aon_pwr_otp_req; |
| 403 | pwrmgr_pkg::pwr_otp_rsp_t pwrmgr_aon_pwr_otp_rsp; |
| 404 | pwrmgr_pkg::pwr_lc_req_t pwrmgr_aon_pwr_lc_req; |
| 405 | pwrmgr_pkg::pwr_lc_rsp_t pwrmgr_aon_pwr_lc_rsp; |
Timothy Chen | 580ed91 | 2020-12-21 21:21:50 -0800 | [diff] [blame] | 406 | rv_core_ibex_pkg::crashdump_t rv_core_ibex_crashdump; |
Timothy Chen | c2b279a | 2021-01-14 18:53:34 -0800 | [diff] [blame] | 407 | logic usbdev_usb_out_of_rst; |
| 408 | logic usbdev_usb_aon_wake_en; |
| 409 | logic usbdev_usb_aon_wake_ack; |
| 410 | logic usbdev_usb_suspend; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 411 | usbdev_pkg::awk_state_t pinmux_aon_usb_state_debug; |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 412 | edn_pkg::edn_req_t [3:0] edn0_edn_req; |
| 413 | edn_pkg::edn_rsp_t [3:0] edn0_edn_rsp; |
Timothy Chen | 77cc8b9 | 2020-12-05 09:19:14 -0800 | [diff] [blame] | 414 | otp_ctrl_pkg::otp_keymgr_key_t otp_ctrl_otp_keymgr_key; |
Eunchan Kim | e5d33b7 | 2020-11-03 14:34:16 -0800 | [diff] [blame] | 415 | keymgr_pkg::hw_key_req_t keymgr_kmac_key; |
| 416 | keymgr_pkg::kmac_data_req_t keymgr_kmac_data_req; |
| 417 | keymgr_pkg::kmac_data_rsp_t keymgr_kmac_data_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 418 | logic [3:0] clkmgr_aon_idle; |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 419 | otp_ctrl_pkg::otp_lc_data_t otp_ctrl_otp_lc_data; |
| 420 | otp_ctrl_pkg::lc_otp_program_req_t lc_ctrl_lc_otp_program_req; |
| 421 | otp_ctrl_pkg::lc_otp_program_rsp_t lc_ctrl_lc_otp_program_rsp; |
| 422 | otp_ctrl_pkg::lc_otp_token_req_t lc_ctrl_lc_otp_token_req; |
| 423 | otp_ctrl_pkg::lc_otp_token_rsp_t lc_ctrl_lc_otp_token_rsp; |
| 424 | otp_ctrl_part_pkg::otp_hw_cfg_t otp_ctrl_otp_hw_cfg; |
| 425 | lc_ctrl_pkg::lc_keymgr_div_t lc_ctrl_lc_keymgr_div; |
| 426 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_dft_en; |
| 427 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_nvm_debug_en; |
| 428 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_hw_debug_en; |
| 429 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_cpu_en; |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 430 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_escalate_en; |
Michael Schaffner | c506dc5 | 2020-12-22 21:07:17 -0800 | [diff] [blame] | 431 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_check_byp_en; |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 432 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_clk_byp_req; |
Timothy Chen | 33c9078 | 2021-01-06 17:38:48 -0800 | [diff] [blame] | 433 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_clk_byp_ack; |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 434 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_creator_seed_sw_rw_en; |
| 435 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_owner_seed_sw_rw_en; |
| 436 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_iso_part_sw_rd_en; |
| 437 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_iso_part_sw_wr_en; |
| 438 | lc_ctrl_pkg::lc_tx_t lc_ctrl_lc_seed_hw_rd_en; |
Timothy Chen | bea7b6a | 2021-01-21 13:59:20 -0800 | [diff] [blame] | 439 | logic [1:0] pwrmgr_aon_wakeups; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 440 | logic pwrmgr_aon_rstreqs; |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 441 | tlul_pkg::tl_h2d_t rom_tl_req; |
| 442 | tlul_pkg::tl_d2h_t rom_tl_rsp; |
| 443 | tlul_pkg::tl_h2d_t ram_main_tl_req; |
| 444 | tlul_pkg::tl_d2h_t ram_main_tl_rsp; |
| 445 | tlul_pkg::tl_h2d_t eflash_tl_req; |
| 446 | tlul_pkg::tl_d2h_t eflash_tl_rsp; |
| 447 | tlul_pkg::tl_h2d_t main_tl_peri_req; |
| 448 | tlul_pkg::tl_d2h_t main_tl_peri_rsp; |
| 449 | tlul_pkg::tl_h2d_t flash_ctrl_tl_req; |
| 450 | tlul_pkg::tl_d2h_t flash_ctrl_tl_rsp; |
| 451 | tlul_pkg::tl_h2d_t hmac_tl_req; |
| 452 | tlul_pkg::tl_d2h_t hmac_tl_rsp; |
Eunchan Kim | e5d33b7 | 2020-11-03 14:34:16 -0800 | [diff] [blame] | 453 | tlul_pkg::tl_h2d_t kmac_tl_req; |
| 454 | tlul_pkg::tl_d2h_t kmac_tl_rsp; |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 455 | tlul_pkg::tl_h2d_t aes_tl_req; |
| 456 | tlul_pkg::tl_d2h_t aes_tl_rsp; |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 457 | tlul_pkg::tl_h2d_t entropy_src_tl_req; |
| 458 | tlul_pkg::tl_d2h_t entropy_src_tl_rsp; |
| 459 | tlul_pkg::tl_h2d_t csrng_tl_req; |
| 460 | tlul_pkg::tl_d2h_t csrng_tl_rsp; |
| 461 | tlul_pkg::tl_h2d_t edn0_tl_req; |
| 462 | tlul_pkg::tl_d2h_t edn0_tl_rsp; |
| 463 | tlul_pkg::tl_h2d_t edn1_tl_req; |
| 464 | tlul_pkg::tl_d2h_t edn1_tl_rsp; |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 465 | tlul_pkg::tl_h2d_t rv_plic_tl_req; |
| 466 | tlul_pkg::tl_d2h_t rv_plic_tl_rsp; |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 467 | tlul_pkg::tl_h2d_t otbn_tl_req; |
| 468 | tlul_pkg::tl_d2h_t otbn_tl_rsp; |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 469 | tlul_pkg::tl_h2d_t keymgr_tl_req; |
| 470 | tlul_pkg::tl_d2h_t keymgr_tl_rsp; |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 471 | tlul_pkg::tl_h2d_t sram_ctrl_main_tl_req; |
| 472 | tlul_pkg::tl_d2h_t sram_ctrl_main_tl_rsp; |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 473 | tlul_pkg::tl_h2d_t uart0_tl_req; |
| 474 | tlul_pkg::tl_d2h_t uart0_tl_rsp; |
| 475 | tlul_pkg::tl_h2d_t uart1_tl_req; |
| 476 | tlul_pkg::tl_d2h_t uart1_tl_rsp; |
| 477 | tlul_pkg::tl_h2d_t uart2_tl_req; |
| 478 | tlul_pkg::tl_d2h_t uart2_tl_rsp; |
| 479 | tlul_pkg::tl_h2d_t uart3_tl_req; |
| 480 | tlul_pkg::tl_d2h_t uart3_tl_rsp; |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 481 | tlul_pkg::tl_h2d_t i2c0_tl_req; |
| 482 | tlul_pkg::tl_d2h_t i2c0_tl_rsp; |
| 483 | tlul_pkg::tl_h2d_t i2c1_tl_req; |
| 484 | tlul_pkg::tl_d2h_t i2c1_tl_rsp; |
| 485 | tlul_pkg::tl_h2d_t i2c2_tl_req; |
| 486 | tlul_pkg::tl_d2h_t i2c2_tl_rsp; |
| 487 | tlul_pkg::tl_h2d_t pattgen_tl_req; |
| 488 | tlul_pkg::tl_d2h_t pattgen_tl_rsp; |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 489 | tlul_pkg::tl_h2d_t gpio_tl_req; |
| 490 | tlul_pkg::tl_d2h_t gpio_tl_rsp; |
| 491 | tlul_pkg::tl_h2d_t spi_device_tl_req; |
| 492 | tlul_pkg::tl_d2h_t spi_device_tl_rsp; |
| 493 | tlul_pkg::tl_h2d_t rv_timer_tl_req; |
| 494 | tlul_pkg::tl_d2h_t rv_timer_tl_rsp; |
| 495 | tlul_pkg::tl_h2d_t usbdev_tl_req; |
| 496 | tlul_pkg::tl_d2h_t usbdev_tl_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 497 | tlul_pkg::tl_h2d_t pwrmgr_aon_tl_req; |
| 498 | tlul_pkg::tl_d2h_t pwrmgr_aon_tl_rsp; |
| 499 | tlul_pkg::tl_h2d_t rstmgr_aon_tl_req; |
| 500 | tlul_pkg::tl_d2h_t rstmgr_aon_tl_rsp; |
| 501 | tlul_pkg::tl_h2d_t clkmgr_aon_tl_req; |
| 502 | tlul_pkg::tl_d2h_t clkmgr_aon_tl_rsp; |
| 503 | tlul_pkg::tl_h2d_t pinmux_aon_tl_req; |
| 504 | tlul_pkg::tl_d2h_t pinmux_aon_tl_rsp; |
| 505 | tlul_pkg::tl_h2d_t padctrl_aon_tl_req; |
| 506 | tlul_pkg::tl_d2h_t padctrl_aon_tl_rsp; |
| 507 | tlul_pkg::tl_h2d_t ram_ret_aon_tl_req; |
| 508 | tlul_pkg::tl_d2h_t ram_ret_aon_tl_rsp; |
Michael Schaffner | a304560 | 2020-10-06 19:19:46 -0700 | [diff] [blame] | 509 | tlul_pkg::tl_h2d_t otp_ctrl_tl_req; |
| 510 | tlul_pkg::tl_d2h_t otp_ctrl_tl_rsp; |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 511 | tlul_pkg::tl_h2d_t lc_ctrl_tl_req; |
| 512 | tlul_pkg::tl_d2h_t lc_ctrl_tl_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 513 | tlul_pkg::tl_h2d_t sensor_ctrl_aon_tl_req; |
| 514 | tlul_pkg::tl_d2h_t sensor_ctrl_aon_tl_rsp; |
Michael Schaffner | d1fc7d1 | 2020-12-21 12:52:23 -0800 | [diff] [blame] | 515 | tlul_pkg::tl_h2d_t alert_handler_tl_req; |
| 516 | tlul_pkg::tl_d2h_t alert_handler_tl_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 517 | tlul_pkg::tl_h2d_t sram_ctrl_ret_aon_tl_req; |
| 518 | tlul_pkg::tl_d2h_t sram_ctrl_ret_aon_tl_rsp; |
Michael Schaffner | d1fc7d1 | 2020-12-21 12:52:23 -0800 | [diff] [blame] | 519 | tlul_pkg::tl_h2d_t nmi_gen_tl_req; |
| 520 | tlul_pkg::tl_d2h_t nmi_gen_tl_rsp; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 521 | rstmgr_pkg::rstmgr_out_t rstmgr_aon_resets; |
| 522 | rstmgr_pkg::rstmgr_cpu_t rstmgr_aon_cpu; |
| 523 | pwrmgr_pkg::pwr_cpu_t pwrmgr_aon_pwr_cpu; |
| 524 | clkmgr_pkg::clkmgr_out_t clkmgr_aon_clocks; |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 525 | tlul_pkg::tl_h2d_t main_tl_corei_req; |
| 526 | tlul_pkg::tl_d2h_t main_tl_corei_rsp; |
| 527 | tlul_pkg::tl_h2d_t main_tl_cored_req; |
| 528 | tlul_pkg::tl_d2h_t main_tl_cored_rsp; |
| 529 | tlul_pkg::tl_h2d_t main_tl_dm_sba_req; |
| 530 | tlul_pkg::tl_d2h_t main_tl_dm_sba_rsp; |
| 531 | tlul_pkg::tl_h2d_t main_tl_debug_mem_req; |
| 532 | tlul_pkg::tl_d2h_t main_tl_debug_mem_rsp; |
Pirmin Vogel | a2d411d | 2020-07-13 17:33:42 +0200 | [diff] [blame] | 533 | |
Timothy Chen | 075ed37 | 2021-02-04 14:42:29 -0800 | [diff] [blame^] | 534 | // define mixed connection to port |
| 535 | assign edn0_edn_req[2] = ast_edn_edn_req_i; |
| 536 | assign ast_edn_edn_rsp_o = edn0_edn_rsp[2]; |
| 537 | |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 538 | // define partial inter-module tie-off |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 539 | edn_pkg::edn_rsp_t unused_edn0_edn_rsp3; |
| 540 | |
| 541 | // assign partial inter-module tie-off |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 542 | assign unused_edn0_edn_rsp3 = edn0_edn_rsp[3]; |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 543 | assign edn0_edn_req[3] = '0; |
| 544 | |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 545 | |
Timothy Chen | 3b50be1 | 2020-11-11 13:19:59 -0800 | [diff] [blame] | 546 | // Unused reset signals |
| 547 | logic unused_d0_rst_por_aon; |
| 548 | logic unused_d0_rst_por; |
| 549 | logic unused_d0_rst_por_io; |
| 550 | logic unused_d0_rst_por_io_div2; |
| 551 | logic unused_d0_rst_por_io_div4; |
| 552 | logic unused_d0_rst_por_usb; |
| 553 | logic unused_daon_rst_lc; |
| 554 | logic unused_daon_rst_lc_io_div4; |
Timothy Chen | 3b50be1 | 2020-11-11 13:19:59 -0800 | [diff] [blame] | 555 | logic unused_daon_rst_spi_device; |
Timothy Chen | c2b279a | 2021-01-14 18:53:34 -0800 | [diff] [blame] | 556 | logic unused_daon_rst_usb; |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 557 | logic unused_daon_rst_i2c0; |
| 558 | logic unused_daon_rst_i2c1; |
| 559 | logic unused_daon_rst_i2c2; |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 560 | assign unused_d0_rst_por_aon = rstmgr_aon_resets.rst_por_aon_n[rstmgr_pkg::Domain0Sel]; |
| 561 | assign unused_d0_rst_por = rstmgr_aon_resets.rst_por_n[rstmgr_pkg::Domain0Sel]; |
| 562 | assign unused_d0_rst_por_io = rstmgr_aon_resets.rst_por_io_n[rstmgr_pkg::Domain0Sel]; |
| 563 | assign unused_d0_rst_por_io_div2 = rstmgr_aon_resets.rst_por_io_div2_n[rstmgr_pkg::Domain0Sel]; |
| 564 | assign unused_d0_rst_por_io_div4 = rstmgr_aon_resets.rst_por_io_div4_n[rstmgr_pkg::Domain0Sel]; |
| 565 | assign unused_d0_rst_por_usb = rstmgr_aon_resets.rst_por_usb_n[rstmgr_pkg::Domain0Sel]; |
| 566 | assign unused_daon_rst_lc = rstmgr_aon_resets.rst_lc_n[rstmgr_pkg::DomainAonSel]; |
| 567 | assign unused_daon_rst_lc_io_div4 = rstmgr_aon_resets.rst_lc_io_div4_n[rstmgr_pkg::DomainAonSel]; |
| 568 | assign unused_daon_rst_spi_device = rstmgr_aon_resets.rst_spi_device_n[rstmgr_pkg::DomainAonSel]; |
| 569 | assign unused_daon_rst_usb = rstmgr_aon_resets.rst_usb_n[rstmgr_pkg::DomainAonSel]; |
| 570 | assign unused_daon_rst_i2c0 = rstmgr_aon_resets.rst_i2c0_n[rstmgr_pkg::DomainAonSel]; |
| 571 | assign unused_daon_rst_i2c1 = rstmgr_aon_resets.rst_i2c1_n[rstmgr_pkg::DomainAonSel]; |
| 572 | assign unused_daon_rst_i2c2 = rstmgr_aon_resets.rst_i2c2_n[rstmgr_pkg::DomainAonSel]; |
Timothy Chen | 3b50be1 | 2020-11-11 13:19:59 -0800 | [diff] [blame] | 573 | |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 574 | // Non-debug module reset == reset for everything except for the debug module |
| 575 | logic ndmreset_req; |
| 576 | |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 577 | // debug request from rv_dm to core |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 578 | logic debug_req; |
| 579 | |
| 580 | // processor core |
| 581 | rv_core_ibex #( |
Philipp Wagner | 25d88922 | 2020-04-03 11:52:41 +0100 | [diff] [blame] | 582 | .PMPEnable (1), |
| 583 | .PMPGranularity (0), // 2^(PMPGranularity+2) == 4 byte granularity |
| 584 | .PMPNumRegions (16), |
Pirmin Vogel | 185d1bf | 2020-08-27 13:30:10 +0200 | [diff] [blame] | 585 | .MHPMCounterNum (10), |
| 586 | .MHPMCounterWidth (32), |
Greg Chadwick | dadb1af | 2020-04-16 17:10:23 +0100 | [diff] [blame] | 587 | .RV32E (0), |
Pirmin Vogel | e381464 | 2020-08-27 12:44:23 +0200 | [diff] [blame] | 588 | .RV32M (ibex_pkg::RV32MSingleCycle), |
| 589 | .RV32B (ibex_pkg::RV32BNone), |
Pirmin Vogel | 4eb2502 | 2020-08-27 15:27:33 +0200 | [diff] [blame] | 590 | .RegFile (IbexRegFile), |
Greg Chadwick | dadb1af | 2020-04-16 17:10:23 +0100 | [diff] [blame] | 591 | .BranchTargetALU (1), |
| 592 | .WritebackStage (1), |
Tom Roberts | 7824ccc | 2020-11-05 11:34:03 +0000 | [diff] [blame] | 593 | .ICache (IbexICache), |
| 594 | .ICacheECC (1), |
Pirmin Vogel | e381464 | 2020-08-27 12:44:23 +0200 | [diff] [blame] | 595 | .BranchPredictor (0), |
Greg Chadwick | dadb1af | 2020-04-16 17:10:23 +0100 | [diff] [blame] | 596 | .DbgTriggerEn (1), |
Tom Roberts | 78bb2ae | 2020-06-03 15:24:22 +0100 | [diff] [blame] | 597 | .SecureIbex (0), |
Greg Chadwick | dadb1af | 2020-04-16 17:10:23 +0100 | [diff] [blame] | 598 | .DmHaltAddr (ADDR_SPACE_DEBUG_MEM + dm::HaltAddress), |
| 599 | .DmExceptionAddr (ADDR_SPACE_DEBUG_MEM + dm::ExceptionAddress), |
| 600 | .PipeLine (IbexPipeLine) |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 601 | ) u_rv_core_ibex ( |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 602 | // clock and reset |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 603 | .clk_i (clkmgr_aon_clocks.clk_proc_main), |
| 604 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
| 605 | .clk_esc_i (clkmgr_aon_clocks.clk_io_div4_timers), |
| 606 | .rst_esc_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 607 | .test_en_i (1'b0), |
| 608 | // static pinning |
Greg Chadwick | 53ef2ec | 2019-09-03 14:53:54 +0100 | [diff] [blame] | 609 | .hart_id_i (32'b0), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 610 | .boot_addr_i (ADDR_SPACE_ROM), |
| 611 | // TL-UL buses |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 612 | .tl_i_o (main_tl_corei_req), |
| 613 | .tl_i_i (main_tl_corei_rsp), |
| 614 | .tl_d_o (main_tl_cored_req), |
| 615 | .tl_d_i (main_tl_cored_rsp), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 616 | // interrupts |
| 617 | .irq_software_i (msip), |
| 618 | .irq_timer_i (intr_rv_timer_timer_expired_0_0), |
| 619 | .irq_external_i (irq_plic), |
Michael Schaffner | bdcbd20 | 2020-07-27 12:18:21 -0700 | [diff] [blame] | 620 | // escalation input from alert handler (NMI) |
Timothy Chen | c0d32d9 | 2020-12-16 18:01:22 -0800 | [diff] [blame] | 621 | .esc_tx_i (alert_handler_esc_tx[0]), |
| 622 | .esc_rx_o (alert_handler_esc_rx[0]), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 623 | // debug interface |
| 624 | .debug_req_i (debug_req), |
Timothy Chen | 580ed91 | 2020-12-21 21:21:50 -0800 | [diff] [blame] | 625 | // crash dump interface |
| 626 | .crash_dump_o (rv_core_ibex_crashdump), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 627 | // CPU control signals |
Pirmin Vogel | ffc9e83 | 2019-09-13 16:16:05 +0100 | [diff] [blame] | 628 | .fetch_enable_i (1'b1), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 629 | .core_sleep_o (pwrmgr_aon_pwr_cpu.core_sleeping) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 630 | ); |
| 631 | |
| 632 | // Debug Module (RISC-V Debug Spec 0.13) |
| 633 | // |
| 634 | |
Michael Schaffner | a03f158 | 2020-11-19 22:16:27 -0800 | [diff] [blame] | 635 | // TODO: this will be routed to the pinmux for TAP selection |
| 636 | // based on straps and LC control signals. |
Michael Schaffner | 382210d | 2020-12-07 12:18:42 -0800 | [diff] [blame] | 637 | jtag_pkg::jtag_req_t jtag_req; |
| 638 | jtag_pkg::jtag_rsp_t jtag_rsp; |
Michael Schaffner | a03f158 | 2020-11-19 22:16:27 -0800 | [diff] [blame] | 639 | logic unused_jtag_tdo_oe_o; |
| 640 | |
| 641 | assign jtag_req.tck = jtag_tck_i; |
| 642 | assign jtag_req.tms = jtag_tms_i; |
| 643 | assign jtag_req.trst_n = jtag_trst_ni; |
| 644 | assign jtag_req.tdi = jtag_tdi_i; |
| 645 | assign jtag_tdo_o = jtag_rsp.tdo; |
| 646 | assign unused_jtag_tdo_oe_o = jtag_rsp.tdo_oe; |
| 647 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 648 | rv_dm #( |
Philipp Wagner | 086b703 | 2019-10-25 17:06:15 +0100 | [diff] [blame] | 649 | .NrHarts (1), |
| 650 | .IdcodeValue (JTAG_IDCODE) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 651 | ) u_dm_top ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 652 | .clk_i (clkmgr_aon_clocks.clk_proc_main), |
| 653 | .rst_ni (rstmgr_aon_resets.rst_lc_n[rstmgr_pkg::Domain0Sel]), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 654 | .testmode_i (1'b0), |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 655 | .ndmreset_o (ndmreset_req), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 656 | .dmactive_o (), |
| 657 | .debug_req_o (debug_req), |
| 658 | .unavailable_i (1'b0), |
| 659 | |
| 660 | // bus device with debug memory (for execution-based debug) |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 661 | .tl_d_i (main_tl_debug_mem_req), |
| 662 | .tl_d_o (main_tl_debug_mem_rsp), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 663 | |
| 664 | // bus host (for system bus accesses, SBA) |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 665 | .tl_h_o (main_tl_dm_sba_req), |
| 666 | .tl_h_i (main_tl_dm_sba_rsp), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 667 | |
| 668 | //JTAG |
Michael Schaffner | a03f158 | 2020-11-19 22:16:27 -0800 | [diff] [blame] | 669 | .jtag_req_i (jtag_req), |
| 670 | .jtag_rsp_o (jtag_rsp) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 671 | ); |
| 672 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 673 | assign rstmgr_aon_cpu.ndmreset_req = ndmreset_req; |
| 674 | assign rstmgr_aon_cpu.rst_cpu_n = rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]; |
Timothy Chen | c59f701 | 2020-04-16 19:11:42 -0700 | [diff] [blame] | 675 | |
Timothy Chen | 4446103 | 2019-09-20 15:35:20 -0700 | [diff] [blame] | 676 | // ROM device |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 677 | logic rom_req; |
Timothy Chen | da2e344 | 2020-02-24 21:37:47 -0800 | [diff] [blame] | 678 | logic [11:0] rom_addr; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 679 | logic [31:0] rom_rdata; |
| 680 | logic rom_rvalid; |
| 681 | |
| 682 | tlul_adapter_sram #( |
Timothy Chen | da2e344 | 2020-02-24 21:37:47 -0800 | [diff] [blame] | 683 | .SramAw(12), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 684 | .SramDw(32), |
Eunchan Kim | 6c731a8 | 2020-03-04 14:48:52 -0800 | [diff] [blame] | 685 | .Outstanding(2), |
Timothy Chen | 4446103 | 2019-09-20 15:35:20 -0700 | [diff] [blame] | 686 | .ErrOnWrite(1) |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 687 | ) u_tl_adapter_rom ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 688 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 689 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 690 | |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 691 | .tl_i (rom_tl_req), |
| 692 | .tl_o (rom_tl_rsp), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 693 | |
| 694 | .req_o (rom_req), |
| 695 | .gnt_i (1'b1), // Always grant as only one requester exists |
Timothy Chen | 4446103 | 2019-09-20 15:35:20 -0700 | [diff] [blame] | 696 | .we_o (), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 697 | .addr_o (rom_addr), |
Timothy Chen | 4446103 | 2019-09-20 15:35:20 -0700 | [diff] [blame] | 698 | .wdata_o (), |
| 699 | .wmask_o (), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 700 | .rdata_i (rom_rdata), |
| 701 | .rvalid_i (rom_rvalid), |
| 702 | .rerror_i (2'b00) |
| 703 | ); |
| 704 | |
Michael Schaffner | 0beb8a4 | 2020-06-05 23:17:40 -0700 | [diff] [blame] | 705 | prim_rom_adv #( |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 706 | .Width(32), |
Philipp Wagner | a37bcfa | 2020-05-19 22:46:41 +0100 | [diff] [blame] | 707 | .Depth(4096), |
| 708 | .MemInitFile(BootRomInitFile) |
Timothy Chen | 4446103 | 2019-09-20 15:35:20 -0700 | [diff] [blame] | 709 | ) u_rom_rom ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 710 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 711 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
Michael Schaffner | 0beb8a4 | 2020-06-05 23:17:40 -0700 | [diff] [blame] | 712 | .req_i (rom_req), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 713 | .addr_i (rom_addr), |
Michael Schaffner | 0beb8a4 | 2020-06-05 23:17:40 -0700 | [diff] [blame] | 714 | .rdata_o (rom_rdata), |
| 715 | .rvalid_o (rom_rvalid), |
| 716 | .cfg_i ('0) // tied off for now |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 717 | ); |
Timothy Chen | 4446103 | 2019-09-20 15:35:20 -0700 | [diff] [blame] | 718 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 719 | // sram device |
| 720 | logic ram_main_req; |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 721 | logic ram_main_gnt; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 722 | logic ram_main_we; |
Timothy Chen | 4367c48 | 2021-01-22 00:18:45 -0800 | [diff] [blame] | 723 | logic [14:0] ram_main_addr; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 724 | logic [31:0] ram_main_wdata; |
| 725 | logic [31:0] ram_main_wmask; |
| 726 | logic [31:0] ram_main_rdata; |
| 727 | logic ram_main_rvalid; |
Philipp Wagner | e1efc18 | 2020-05-21 18:26:17 +0100 | [diff] [blame] | 728 | logic [1:0] ram_main_rerror; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 729 | |
| 730 | tlul_adapter_sram #( |
Timothy Chen | 4367c48 | 2021-01-22 00:18:45 -0800 | [diff] [blame] | 731 | .SramAw(15), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 732 | .SramDw(32), |
Eunchan Kim | 6c731a8 | 2020-03-04 14:48:52 -0800 | [diff] [blame] | 733 | .Outstanding(2) |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 734 | ) u_tl_adapter_ram_main ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 735 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 736 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 737 | .tl_i (ram_main_tl_req), |
| 738 | .tl_o (ram_main_tl_rsp), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 739 | |
| 740 | .req_o (ram_main_req), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 741 | .gnt_i (ram_main_gnt), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 742 | .we_o (ram_main_we), |
| 743 | .addr_o (ram_main_addr), |
| 744 | .wdata_o (ram_main_wdata), |
| 745 | .wmask_o (ram_main_wmask), |
| 746 | .rdata_i (ram_main_rdata), |
| 747 | .rvalid_i (ram_main_rvalid), |
Philipp Wagner | e1efc18 | 2020-05-21 18:26:17 +0100 | [diff] [blame] | 748 | .rerror_i (ram_main_rerror) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 749 | ); |
| 750 | |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 751 | prim_ram_1p_scr #( |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 752 | .Width(32), |
Timothy Chen | 4367c48 | 2021-01-22 00:18:45 -0800 | [diff] [blame] | 753 | .Depth(32768), |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 754 | .CfgWidth(8) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 755 | ) u_ram1p_ram_main ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 756 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 757 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 758 | |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 759 | .key_valid_i ( sram_ctrl_main_sram_scr_req.valid ), |
| 760 | .key_i ( sram_ctrl_main_sram_scr_req.key ), |
| 761 | .nonce_i ( sram_ctrl_main_sram_scr_req.nonce ), |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 762 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 763 | .req_i (ram_main_req), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 764 | .gnt_o (ram_main_gnt), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 765 | .write_i (ram_main_we), |
| 766 | .addr_i (ram_main_addr), |
| 767 | .wdata_i (ram_main_wdata), |
| 768 | .wmask_i (ram_main_wmask), |
Philipp Wagner | e1efc18 | 2020-05-21 18:26:17 +0100 | [diff] [blame] | 769 | .rdata_o (ram_main_rdata), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 770 | .rvalid_o (ram_main_rvalid), |
Philipp Wagner | e1efc18 | 2020-05-21 18:26:17 +0100 | [diff] [blame] | 771 | .rerror_o (ram_main_rerror), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 772 | .raddr_o ( sram_ctrl_main_sram_scr_rsp.raddr ), |
| 773 | .cfg_i ( '0 ) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 774 | ); |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 775 | |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 776 | assign sram_ctrl_main_sram_scr_rsp.rerror = ram_main_rerror; |
| 777 | |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 778 | // sram device |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 779 | logic ram_ret_aon_req; |
| 780 | logic ram_ret_aon_gnt; |
| 781 | logic ram_ret_aon_we; |
| 782 | logic [9:0] ram_ret_aon_addr; |
| 783 | logic [31:0] ram_ret_aon_wdata; |
| 784 | logic [31:0] ram_ret_aon_wmask; |
| 785 | logic [31:0] ram_ret_aon_rdata; |
| 786 | logic ram_ret_aon_rvalid; |
| 787 | logic [1:0] ram_ret_aon_rerror; |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 788 | |
| 789 | tlul_adapter_sram #( |
| 790 | .SramAw(10), |
| 791 | .SramDw(32), |
| 792 | .Outstanding(2) |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 793 | ) u_tl_adapter_ram_ret_aon ( |
| 794 | .clk_i (clkmgr_aon_clocks.clk_io_div4_infra), |
| 795 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::DomainAonSel]), |
| 796 | .tl_i (ram_ret_aon_tl_req), |
| 797 | .tl_o (ram_ret_aon_tl_rsp), |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 798 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 799 | .req_o (ram_ret_aon_req), |
| 800 | .gnt_i (ram_ret_aon_gnt), |
| 801 | .we_o (ram_ret_aon_we), |
| 802 | .addr_o (ram_ret_aon_addr), |
| 803 | .wdata_o (ram_ret_aon_wdata), |
| 804 | .wmask_o (ram_ret_aon_wmask), |
| 805 | .rdata_i (ram_ret_aon_rdata), |
| 806 | .rvalid_i (ram_ret_aon_rvalid), |
| 807 | .rerror_i (ram_ret_aon_rerror) |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 808 | ); |
| 809 | |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 810 | prim_ram_1p_scr #( |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 811 | .Width(32), |
| 812 | .Depth(1024), |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 813 | .CfgWidth(8) |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 814 | ) u_ram1p_ram_ret_aon ( |
| 815 | .clk_i (clkmgr_aon_clocks.clk_io_div4_infra), |
| 816 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::DomainAonSel]), |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 817 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 818 | .key_valid_i ( sram_ctrl_ret_aon_sram_scr_req.valid ), |
| 819 | .key_i ( sram_ctrl_ret_aon_sram_scr_req.key ), |
| 820 | .nonce_i ( sram_ctrl_ret_aon_sram_scr_req.nonce ), |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 821 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 822 | .req_i (ram_ret_aon_req), |
| 823 | .gnt_o (ram_ret_aon_gnt), |
| 824 | .write_i (ram_ret_aon_we), |
| 825 | .addr_i (ram_ret_aon_addr), |
| 826 | .wdata_i (ram_ret_aon_wdata), |
| 827 | .wmask_i (ram_ret_aon_wmask), |
| 828 | .rdata_o (ram_ret_aon_rdata), |
| 829 | .rvalid_o (ram_ret_aon_rvalid), |
| 830 | .rerror_o (ram_ret_aon_rerror), |
| 831 | .raddr_o ( sram_ctrl_ret_aon_sram_scr_rsp.raddr ), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 832 | .cfg_i ( '0 ) |
Timothy Chen | 6e2ba84 | 2020-06-29 15:04:13 -0700 | [diff] [blame] | 833 | ); |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 834 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 835 | assign sram_ctrl_ret_aon_sram_scr_rsp.rerror = ram_ret_aon_rerror; |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 836 | |
Michael Schaffner | bec47c7 | 2020-11-06 14:03:54 -0800 | [diff] [blame] | 837 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 838 | // host to flash communication |
| 839 | logic flash_host_req; |
| 840 | logic flash_host_req_rdy; |
| 841 | logic flash_host_req_done; |
Timothy Chen | d9a9877 | 2020-09-15 13:57:03 -0700 | [diff] [blame] | 842 | logic flash_host_rderr; |
Timothy Chen | 1451840 | 2020-04-13 15:25:22 -0700 | [diff] [blame] | 843 | logic [flash_ctrl_pkg::BusWidth-1:0] flash_host_rdata; |
Timothy Chen | b35a340 | 2020-06-23 00:14:11 -0700 | [diff] [blame] | 844 | logic [flash_ctrl_pkg::BusAddrW-1:0] flash_host_addr; |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 845 | |
Timothy Chen | 5aec528 | 2019-09-10 21:10:56 -0700 | [diff] [blame] | 846 | tlul_adapter_sram #( |
Timothy Chen | b35a340 | 2020-06-23 00:14:11 -0700 | [diff] [blame] | 847 | .SramAw(flash_ctrl_pkg::BusAddrW), |
Timothy Chen | 1451840 | 2020-04-13 15:25:22 -0700 | [diff] [blame] | 848 | .SramDw(flash_ctrl_pkg::BusWidth), |
Eunchan Kim | 6c731a8 | 2020-03-04 14:48:52 -0800 | [diff] [blame] | 849 | .Outstanding(2), |
Timothy Chen | 5aec528 | 2019-09-10 21:10:56 -0700 | [diff] [blame] | 850 | .ByteAccess(0), |
| 851 | .ErrOnWrite(1) |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 852 | ) u_tl_adapter_eflash ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 853 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 854 | .rst_ni (rstmgr_aon_resets.rst_lc_n[rstmgr_pkg::Domain0Sel]), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 855 | |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 856 | .tl_i (eflash_tl_req), |
| 857 | .tl_o (eflash_tl_rsp), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 858 | |
Timothy Chen | 5aec528 | 2019-09-10 21:10:56 -0700 | [diff] [blame] | 859 | .req_o (flash_host_req), |
| 860 | .gnt_i (flash_host_req_rdy), |
| 861 | .we_o (), |
| 862 | .addr_o (flash_host_addr), |
| 863 | .wdata_o (), |
| 864 | .wmask_o (), |
| 865 | .rdata_i (flash_host_rdata), |
| 866 | .rvalid_i (flash_host_req_done), |
Timothy Chen | d9a9877 | 2020-09-15 13:57:03 -0700 | [diff] [blame] | 867 | .rerror_i ({flash_host_rderr,1'b0}) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 868 | ); |
| 869 | |
Timothy Chen | 1451840 | 2020-04-13 15:25:22 -0700 | [diff] [blame] | 870 | flash_phy u_flash_eflash ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 871 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 872 | .rst_ni (rstmgr_aon_resets.rst_lc_n[rstmgr_pkg::Domain0Sel]), |
Timothy Chen | 1b9fd90 | 2021-01-07 12:18:46 -0800 | [diff] [blame] | 873 | .host_req_i (flash_host_req), |
| 874 | .host_addr_i (flash_host_addr), |
| 875 | .host_req_rdy_o (flash_host_req_rdy), |
| 876 | .host_req_done_o (flash_host_req_done), |
| 877 | .host_rderr_o (flash_host_rderr), |
| 878 | .host_rdata_o (flash_host_rdata), |
| 879 | .flash_ctrl_i (flash_ctrl_flash_req), |
| 880 | .flash_ctrl_o (flash_ctrl_flash_rsp), |
| 881 | .lc_nvm_debug_en_i (lc_ctrl_lc_nvm_debug_en), |
| 882 | .jtag_req_i ('0), |
| 883 | .jtag_rsp_o (), |
| 884 | .flash_bist_enable_i, |
Timothy Chen | 2422a6c | 2020-11-19 16:06:14 -0800 | [diff] [blame] | 885 | .flash_power_down_h_i, |
| 886 | .flash_power_ready_h_i, |
| 887 | .flash_test_mode_a_i, |
| 888 | .flash_test_voltage_h_i, |
| 889 | .scanmode_i, |
Timothy Chen | 010e3cc | 2021-02-02 14:55:09 -0800 | [diff] [blame] | 890 | .scan_en_i, |
Timothy Chen | 2422a6c | 2020-11-19 16:06:14 -0800 | [diff] [blame] | 891 | .scan_rst_ni |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 892 | ); |
| 893 | |
| 894 | |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 895 | |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 896 | uart u_uart0 ( |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 897 | |
| 898 | // Input |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 899 | .cio_rx_i (cio_uart0_rx_p2d), |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 900 | |
| 901 | // Output |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 902 | .cio_tx_o (cio_uart0_tx_d2p), |
| 903 | .cio_tx_en_o (cio_uart0_tx_en_d2p), |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 904 | |
| 905 | // Interrupt |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 906 | .intr_tx_watermark_o (intr_uart0_tx_watermark), |
| 907 | .intr_rx_watermark_o (intr_uart0_rx_watermark), |
| 908 | .intr_tx_empty_o (intr_uart0_tx_empty), |
| 909 | .intr_rx_overflow_o (intr_uart0_rx_overflow), |
| 910 | .intr_rx_frame_err_o (intr_uart0_rx_frame_err), |
| 911 | .intr_rx_break_err_o (intr_uart0_rx_break_err), |
| 912 | .intr_rx_timeout_o (intr_uart0_rx_timeout), |
| 913 | .intr_rx_parity_err_o (intr_uart0_rx_parity_err), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 914 | |
| 915 | // Inter-module signals |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 916 | .tl_i(uart0_tl_req), |
| 917 | .tl_o(uart0_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 918 | |
| 919 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 920 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 921 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 922 | ); |
| 923 | |
| 924 | uart u_uart1 ( |
| 925 | |
| 926 | // Input |
| 927 | .cio_rx_i (cio_uart1_rx_p2d), |
| 928 | |
| 929 | // Output |
| 930 | .cio_tx_o (cio_uart1_tx_d2p), |
| 931 | .cio_tx_en_o (cio_uart1_tx_en_d2p), |
| 932 | |
| 933 | // Interrupt |
| 934 | .intr_tx_watermark_o (intr_uart1_tx_watermark), |
| 935 | .intr_rx_watermark_o (intr_uart1_rx_watermark), |
| 936 | .intr_tx_empty_o (intr_uart1_tx_empty), |
| 937 | .intr_rx_overflow_o (intr_uart1_rx_overflow), |
| 938 | .intr_rx_frame_err_o (intr_uart1_rx_frame_err), |
| 939 | .intr_rx_break_err_o (intr_uart1_rx_break_err), |
| 940 | .intr_rx_timeout_o (intr_uart1_rx_timeout), |
| 941 | .intr_rx_parity_err_o (intr_uart1_rx_parity_err), |
| 942 | |
| 943 | // Inter-module signals |
| 944 | .tl_i(uart1_tl_req), |
| 945 | .tl_o(uart1_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 946 | |
| 947 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 948 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 949 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 950 | ); |
| 951 | |
| 952 | uart u_uart2 ( |
| 953 | |
| 954 | // Input |
| 955 | .cio_rx_i (cio_uart2_rx_p2d), |
| 956 | |
| 957 | // Output |
| 958 | .cio_tx_o (cio_uart2_tx_d2p), |
| 959 | .cio_tx_en_o (cio_uart2_tx_en_d2p), |
| 960 | |
| 961 | // Interrupt |
| 962 | .intr_tx_watermark_o (intr_uart2_tx_watermark), |
| 963 | .intr_rx_watermark_o (intr_uart2_rx_watermark), |
| 964 | .intr_tx_empty_o (intr_uart2_tx_empty), |
| 965 | .intr_rx_overflow_o (intr_uart2_rx_overflow), |
| 966 | .intr_rx_frame_err_o (intr_uart2_rx_frame_err), |
| 967 | .intr_rx_break_err_o (intr_uart2_rx_break_err), |
| 968 | .intr_rx_timeout_o (intr_uart2_rx_timeout), |
| 969 | .intr_rx_parity_err_o (intr_uart2_rx_parity_err), |
| 970 | |
| 971 | // Inter-module signals |
| 972 | .tl_i(uart2_tl_req), |
| 973 | .tl_o(uart2_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 974 | |
| 975 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 976 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 977 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 978 | ); |
| 979 | |
| 980 | uart u_uart3 ( |
| 981 | |
| 982 | // Input |
| 983 | .cio_rx_i (cio_uart3_rx_p2d), |
| 984 | |
| 985 | // Output |
| 986 | .cio_tx_o (cio_uart3_tx_d2p), |
| 987 | .cio_tx_en_o (cio_uart3_tx_en_d2p), |
| 988 | |
| 989 | // Interrupt |
| 990 | .intr_tx_watermark_o (intr_uart3_tx_watermark), |
| 991 | .intr_rx_watermark_o (intr_uart3_rx_watermark), |
| 992 | .intr_tx_empty_o (intr_uart3_tx_empty), |
| 993 | .intr_rx_overflow_o (intr_uart3_rx_overflow), |
| 994 | .intr_rx_frame_err_o (intr_uart3_rx_frame_err), |
| 995 | .intr_rx_break_err_o (intr_uart3_rx_break_err), |
| 996 | .intr_rx_timeout_o (intr_uart3_rx_timeout), |
| 997 | .intr_rx_parity_err_o (intr_uart3_rx_parity_err), |
| 998 | |
| 999 | // Inter-module signals |
| 1000 | .tl_i(uart3_tl_req), |
| 1001 | .tl_o(uart3_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1002 | |
| 1003 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1004 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 1005 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1006 | ); |
| 1007 | |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 1008 | gpio u_gpio ( |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 1009 | |
| 1010 | // Input |
| 1011 | .cio_gpio_i (cio_gpio_gpio_p2d), |
| 1012 | |
| 1013 | // Output |
| 1014 | .cio_gpio_o (cio_gpio_gpio_d2p), |
| 1015 | .cio_gpio_en_o (cio_gpio_gpio_en_d2p), |
| 1016 | |
| 1017 | // Interrupt |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1018 | .intr_gpio_o (intr_gpio_gpio), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 1019 | |
| 1020 | // Inter-module signals |
| 1021 | .tl_i(gpio_tl_req), |
| 1022 | .tl_o(gpio_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1023 | |
| 1024 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1025 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1026 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1027 | ); |
| 1028 | |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 1029 | spi_device u_spi_device ( |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 1030 | |
| 1031 | // Input |
Timothy Chen | c38f789 | 2020-07-16 18:19:48 -0700 | [diff] [blame] | 1032 | .cio_sck_i (cio_spi_device_sck_p2d), |
| 1033 | .cio_csb_i (cio_spi_device_csb_p2d), |
| 1034 | .cio_sdi_i (cio_spi_device_sdi_p2d), |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 1035 | |
| 1036 | // Output |
Timothy Chen | c38f789 | 2020-07-16 18:19:48 -0700 | [diff] [blame] | 1037 | .cio_sdo_o (cio_spi_device_sdo_d2p), |
| 1038 | .cio_sdo_en_o (cio_spi_device_sdo_en_d2p), |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 1039 | |
| 1040 | // Interrupt |
| 1041 | .intr_rxf_o (intr_spi_device_rxf), |
| 1042 | .intr_rxlvl_o (intr_spi_device_rxlvl), |
| 1043 | .intr_txlvl_o (intr_spi_device_txlvl), |
| 1044 | .intr_rxerr_o (intr_spi_device_rxerr), |
| 1045 | .intr_rxoverflow_o (intr_spi_device_rxoverflow), |
Eunchan Kim | 546c0d4 | 2019-09-24 15:07:06 -0700 | [diff] [blame] | 1046 | .intr_txunderflow_o (intr_spi_device_txunderflow), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 1047 | |
| 1048 | // Inter-module signals |
| 1049 | .tl_i(spi_device_tl_req), |
| 1050 | .tl_o(spi_device_tl_rsp), |
Eunchan Kim | 2cfadab | 2019-10-02 12:41:11 -0700 | [diff] [blame] | 1051 | .scanmode_i (scanmode_i), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1052 | |
| 1053 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1054 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1055 | .rst_ni (rstmgr_aon_resets.rst_spi_device_n[rstmgr_pkg::Domain0Sel]) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1056 | ); |
| 1057 | |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1058 | i2c u_i2c0 ( |
| 1059 | |
| 1060 | // Input |
| 1061 | .cio_sda_i (cio_i2c0_sda_p2d), |
| 1062 | .cio_scl_i (cio_i2c0_scl_p2d), |
| 1063 | |
| 1064 | // Output |
| 1065 | .cio_sda_o (cio_i2c0_sda_d2p), |
| 1066 | .cio_sda_en_o (cio_i2c0_sda_en_d2p), |
| 1067 | .cio_scl_o (cio_i2c0_scl_d2p), |
| 1068 | .cio_scl_en_o (cio_i2c0_scl_en_d2p), |
| 1069 | |
| 1070 | // Interrupt |
| 1071 | .intr_fmt_watermark_o (intr_i2c0_fmt_watermark), |
| 1072 | .intr_rx_watermark_o (intr_i2c0_rx_watermark), |
| 1073 | .intr_fmt_overflow_o (intr_i2c0_fmt_overflow), |
| 1074 | .intr_rx_overflow_o (intr_i2c0_rx_overflow), |
| 1075 | .intr_nak_o (intr_i2c0_nak), |
| 1076 | .intr_scl_interference_o (intr_i2c0_scl_interference), |
| 1077 | .intr_sda_interference_o (intr_i2c0_sda_interference), |
| 1078 | .intr_stretch_timeout_o (intr_i2c0_stretch_timeout), |
| 1079 | .intr_sda_unstable_o (intr_i2c0_sda_unstable), |
| 1080 | .intr_trans_complete_o (intr_i2c0_trans_complete), |
| 1081 | .intr_tx_empty_o (intr_i2c0_tx_empty), |
| 1082 | .intr_tx_nonempty_o (intr_i2c0_tx_nonempty), |
| 1083 | .intr_tx_overflow_o (intr_i2c0_tx_overflow), |
| 1084 | .intr_acq_overflow_o (intr_i2c0_acq_overflow), |
| 1085 | .intr_ack_stop_o (intr_i2c0_ack_stop), |
| 1086 | .intr_host_timeout_o (intr_i2c0_host_timeout), |
| 1087 | |
| 1088 | // Inter-module signals |
| 1089 | .tl_i(i2c0_tl_req), |
| 1090 | .tl_o(i2c0_tl_rsp), |
| 1091 | |
| 1092 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1093 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1094 | .rst_ni (rstmgr_aon_resets.rst_i2c0_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1095 | ); |
| 1096 | |
| 1097 | i2c u_i2c1 ( |
| 1098 | |
| 1099 | // Input |
| 1100 | .cio_sda_i (cio_i2c1_sda_p2d), |
| 1101 | .cio_scl_i (cio_i2c1_scl_p2d), |
| 1102 | |
| 1103 | // Output |
| 1104 | .cio_sda_o (cio_i2c1_sda_d2p), |
| 1105 | .cio_sda_en_o (cio_i2c1_sda_en_d2p), |
| 1106 | .cio_scl_o (cio_i2c1_scl_d2p), |
| 1107 | .cio_scl_en_o (cio_i2c1_scl_en_d2p), |
| 1108 | |
| 1109 | // Interrupt |
| 1110 | .intr_fmt_watermark_o (intr_i2c1_fmt_watermark), |
| 1111 | .intr_rx_watermark_o (intr_i2c1_rx_watermark), |
| 1112 | .intr_fmt_overflow_o (intr_i2c1_fmt_overflow), |
| 1113 | .intr_rx_overflow_o (intr_i2c1_rx_overflow), |
| 1114 | .intr_nak_o (intr_i2c1_nak), |
| 1115 | .intr_scl_interference_o (intr_i2c1_scl_interference), |
| 1116 | .intr_sda_interference_o (intr_i2c1_sda_interference), |
| 1117 | .intr_stretch_timeout_o (intr_i2c1_stretch_timeout), |
| 1118 | .intr_sda_unstable_o (intr_i2c1_sda_unstable), |
| 1119 | .intr_trans_complete_o (intr_i2c1_trans_complete), |
| 1120 | .intr_tx_empty_o (intr_i2c1_tx_empty), |
| 1121 | .intr_tx_nonempty_o (intr_i2c1_tx_nonempty), |
| 1122 | .intr_tx_overflow_o (intr_i2c1_tx_overflow), |
| 1123 | .intr_acq_overflow_o (intr_i2c1_acq_overflow), |
| 1124 | .intr_ack_stop_o (intr_i2c1_ack_stop), |
| 1125 | .intr_host_timeout_o (intr_i2c1_host_timeout), |
| 1126 | |
| 1127 | // Inter-module signals |
| 1128 | .tl_i(i2c1_tl_req), |
| 1129 | .tl_o(i2c1_tl_rsp), |
| 1130 | |
| 1131 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1132 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1133 | .rst_ni (rstmgr_aon_resets.rst_i2c1_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1134 | ); |
| 1135 | |
| 1136 | i2c u_i2c2 ( |
| 1137 | |
| 1138 | // Input |
| 1139 | .cio_sda_i (cio_i2c2_sda_p2d), |
| 1140 | .cio_scl_i (cio_i2c2_scl_p2d), |
| 1141 | |
| 1142 | // Output |
| 1143 | .cio_sda_o (cio_i2c2_sda_d2p), |
| 1144 | .cio_sda_en_o (cio_i2c2_sda_en_d2p), |
| 1145 | .cio_scl_o (cio_i2c2_scl_d2p), |
| 1146 | .cio_scl_en_o (cio_i2c2_scl_en_d2p), |
| 1147 | |
| 1148 | // Interrupt |
| 1149 | .intr_fmt_watermark_o (intr_i2c2_fmt_watermark), |
| 1150 | .intr_rx_watermark_o (intr_i2c2_rx_watermark), |
| 1151 | .intr_fmt_overflow_o (intr_i2c2_fmt_overflow), |
| 1152 | .intr_rx_overflow_o (intr_i2c2_rx_overflow), |
| 1153 | .intr_nak_o (intr_i2c2_nak), |
| 1154 | .intr_scl_interference_o (intr_i2c2_scl_interference), |
| 1155 | .intr_sda_interference_o (intr_i2c2_sda_interference), |
| 1156 | .intr_stretch_timeout_o (intr_i2c2_stretch_timeout), |
| 1157 | .intr_sda_unstable_o (intr_i2c2_sda_unstable), |
| 1158 | .intr_trans_complete_o (intr_i2c2_trans_complete), |
| 1159 | .intr_tx_empty_o (intr_i2c2_tx_empty), |
| 1160 | .intr_tx_nonempty_o (intr_i2c2_tx_nonempty), |
| 1161 | .intr_tx_overflow_o (intr_i2c2_tx_overflow), |
| 1162 | .intr_acq_overflow_o (intr_i2c2_acq_overflow), |
| 1163 | .intr_ack_stop_o (intr_i2c2_ack_stop), |
| 1164 | .intr_host_timeout_o (intr_i2c2_host_timeout), |
| 1165 | |
| 1166 | // Inter-module signals |
| 1167 | .tl_i(i2c2_tl_req), |
| 1168 | .tl_o(i2c2_tl_rsp), |
| 1169 | |
| 1170 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1171 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1172 | .rst_ni (rstmgr_aon_resets.rst_i2c2_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1173 | ); |
| 1174 | |
| 1175 | pattgen u_pattgen ( |
| 1176 | |
| 1177 | // Output |
| 1178 | .cio_pda0_tx_o (cio_pattgen_pda0_tx_d2p), |
| 1179 | .cio_pda0_tx_en_o (cio_pattgen_pda0_tx_en_d2p), |
| 1180 | .cio_pcl0_tx_o (cio_pattgen_pcl0_tx_d2p), |
| 1181 | .cio_pcl0_tx_en_o (cio_pattgen_pcl0_tx_en_d2p), |
| 1182 | .cio_pda1_tx_o (cio_pattgen_pda1_tx_d2p), |
| 1183 | .cio_pda1_tx_en_o (cio_pattgen_pda1_tx_en_d2p), |
| 1184 | .cio_pcl1_tx_o (cio_pattgen_pcl1_tx_d2p), |
| 1185 | .cio_pcl1_tx_en_o (cio_pattgen_pcl1_tx_en_d2p), |
| 1186 | |
| 1187 | // Interrupt |
| 1188 | .intr_done_ch0_o (intr_pattgen_done_ch0), |
| 1189 | .intr_done_ch1_o (intr_pattgen_done_ch1), |
| 1190 | |
| 1191 | // Inter-module signals |
| 1192 | .tl_i(pattgen_tl_req), |
| 1193 | .tl_o(pattgen_tl_rsp), |
| 1194 | |
| 1195 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1196 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1197 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1198 | ); |
| 1199 | |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 1200 | rv_timer u_rv_timer ( |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 1201 | |
| 1202 | // Interrupt |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1203 | .intr_timer_expired_0_0_o (intr_rv_timer_timer_expired_0_0), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 1204 | |
| 1205 | // Inter-module signals |
| 1206 | .tl_i(rv_timer_tl_req), |
| 1207 | .tl_o(rv_timer_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1208 | |
| 1209 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1210 | .clk_i (clkmgr_aon_clocks.clk_io_div4_timers), |
| 1211 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 1212 | ); |
| 1213 | |
Michael Schaffner | a39557e | 2020-03-17 18:30:21 -0700 | [diff] [blame] | 1214 | usbdev u_usbdev ( |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 1215 | |
Pirmin Vogel | b054fc0 | 2020-03-11 11:23:03 +0100 | [diff] [blame] | 1216 | // Input |
| 1217 | .cio_sense_i (cio_usbdev_sense_p2d), |
| 1218 | .cio_d_i (cio_usbdev_d_p2d), |
| 1219 | .cio_dp_i (cio_usbdev_dp_p2d), |
| 1220 | .cio_dn_i (cio_usbdev_dn_p2d), |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 1221 | |
Pirmin Vogel | b054fc0 | 2020-03-11 11:23:03 +0100 | [diff] [blame] | 1222 | // Output |
| 1223 | .cio_se0_o (cio_usbdev_se0_d2p), |
| 1224 | .cio_se0_en_o (cio_usbdev_se0_en_d2p), |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 1225 | .cio_dp_pullup_o (cio_usbdev_dp_pullup_d2p), |
| 1226 | .cio_dp_pullup_en_o (cio_usbdev_dp_pullup_en_d2p), |
| 1227 | .cio_dn_pullup_o (cio_usbdev_dn_pullup_d2p), |
| 1228 | .cio_dn_pullup_en_o (cio_usbdev_dn_pullup_en_d2p), |
Pirmin Vogel | b054fc0 | 2020-03-11 11:23:03 +0100 | [diff] [blame] | 1229 | .cio_tx_mode_se_o (cio_usbdev_tx_mode_se_d2p), |
| 1230 | .cio_tx_mode_se_en_o (cio_usbdev_tx_mode_se_en_d2p), |
| 1231 | .cio_suspend_o (cio_usbdev_suspend_d2p), |
| 1232 | .cio_suspend_en_o (cio_usbdev_suspend_en_d2p), |
| 1233 | .cio_d_o (cio_usbdev_d_d2p), |
| 1234 | .cio_d_en_o (cio_usbdev_d_en_d2p), |
| 1235 | .cio_dp_o (cio_usbdev_dp_d2p), |
| 1236 | .cio_dp_en_o (cio_usbdev_dp_en_d2p), |
| 1237 | .cio_dn_o (cio_usbdev_dn_d2p), |
| 1238 | .cio_dn_en_o (cio_usbdev_dn_en_d2p), |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 1239 | |
| 1240 | // Interrupt |
| 1241 | .intr_pkt_received_o (intr_usbdev_pkt_received), |
| 1242 | .intr_pkt_sent_o (intr_usbdev_pkt_sent), |
| 1243 | .intr_disconnected_o (intr_usbdev_disconnected), |
| 1244 | .intr_host_lost_o (intr_usbdev_host_lost), |
| 1245 | .intr_link_reset_o (intr_usbdev_link_reset), |
| 1246 | .intr_link_suspend_o (intr_usbdev_link_suspend), |
| 1247 | .intr_link_resume_o (intr_usbdev_link_resume), |
| 1248 | .intr_av_empty_o (intr_usbdev_av_empty), |
| 1249 | .intr_rx_full_o (intr_usbdev_rx_full), |
| 1250 | .intr_av_overflow_o (intr_usbdev_av_overflow), |
| 1251 | .intr_link_in_err_o (intr_usbdev_link_in_err), |
| 1252 | .intr_rx_crc_err_o (intr_usbdev_rx_crc_err), |
| 1253 | .intr_rx_pid_err_o (intr_usbdev_rx_pid_err), |
| 1254 | .intr_rx_bitstuff_err_o (intr_usbdev_rx_bitstuff_err), |
| 1255 | .intr_frame_o (intr_usbdev_frame), |
| 1256 | .intr_connected_o (intr_usbdev_connected), |
Stefan Lippuner | 207b1a6 | 2020-11-10 09:25:53 +0100 | [diff] [blame] | 1257 | .intr_link_out_err_o (intr_usbdev_link_out_err), |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 1258 | |
Pirmin Vogel | dd3a2f0 | 2020-05-12 14:59:50 +0200 | [diff] [blame] | 1259 | // Inter-module signals |
Timothy Chen | 1555dce | 2020-08-11 11:26:50 -0700 | [diff] [blame] | 1260 | .usb_ref_val_o(usbdev_usb_ref_val_o), |
| 1261 | .usb_ref_pulse_o(usbdev_usb_ref_pulse_o), |
Timothy Chen | c2b279a | 2021-01-14 18:53:34 -0800 | [diff] [blame] | 1262 | .usb_out_of_rst_o(usbdev_usb_out_of_rst), |
| 1263 | .usb_aon_wake_en_o(usbdev_usb_aon_wake_en), |
| 1264 | .usb_aon_wake_ack_o(usbdev_usb_aon_wake_ack), |
| 1265 | .usb_suspend_o(usbdev_usb_suspend), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1266 | .usb_state_debug_i(pinmux_aon_usb_state_debug), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 1267 | .tl_i(usbdev_tl_req), |
| 1268 | .tl_o(usbdev_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1269 | |
| 1270 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1271 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1272 | .clk_aon_i (clkmgr_aon_clocks.clk_aon_peri), |
| 1273 | .clk_usb_48mhz_i (clkmgr_aon_clocks.clk_usb_peri), |
| 1274 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]), |
| 1275 | .rst_aon_ni (rstmgr_aon_resets.rst_sys_aon_n[rstmgr_pkg::Domain0Sel]), |
| 1276 | .rst_usb_48mhz_ni (rstmgr_aon_resets.rst_usb_n[rstmgr_pkg::Domain0Sel]) |
| 1277 | ); |
| 1278 | |
| 1279 | otp_ctrl #( |
| 1280 | .RndCnstLfsrSeed(RndCnstOtpCtrlLfsrSeed), |
| 1281 | .RndCnstLfsrPerm(RndCnstOtpCtrlLfsrPerm) |
| 1282 | ) u_otp_ctrl ( |
| 1283 | |
| 1284 | // Interrupt |
| 1285 | .intr_otp_operation_done_o (intr_otp_ctrl_otp_operation_done), |
| 1286 | .intr_otp_error_o (intr_otp_ctrl_otp_error), |
| 1287 | |
| 1288 | // [0]: fatal_macro_error |
| 1289 | // [1]: fatal_check_error |
| 1290 | .alert_tx_o ( alert_tx[1:0] ), |
| 1291 | .alert_rx_i ( alert_rx[1:0] ), |
| 1292 | |
| 1293 | // Inter-module signals |
| 1294 | .otp_ast_pwr_seq_o(otp_ctrl_otp_ast_pwr_seq_o), |
| 1295 | .otp_ast_pwr_seq_h_i(otp_ctrl_otp_ast_pwr_seq_h_i), |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 1296 | .edn_o(edn0_edn_req[1]), |
| 1297 | .edn_i(edn0_edn_rsp[1]), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1298 | .pwr_otp_i(pwrmgr_aon_pwr_otp_req), |
| 1299 | .pwr_otp_o(pwrmgr_aon_pwr_otp_rsp), |
| 1300 | .lc_otp_program_i(lc_ctrl_lc_otp_program_req), |
| 1301 | .lc_otp_program_o(lc_ctrl_lc_otp_program_rsp), |
| 1302 | .lc_otp_token_i(lc_ctrl_lc_otp_token_req), |
| 1303 | .lc_otp_token_o(lc_ctrl_lc_otp_token_rsp), |
| 1304 | .otp_lc_data_o(otp_ctrl_otp_lc_data), |
| 1305 | .lc_escalate_en_i(lc_ctrl_lc_escalate_en), |
| 1306 | .lc_creator_seed_sw_rw_en_i(lc_ctrl_lc_creator_seed_sw_rw_en), |
| 1307 | .lc_seed_hw_rd_en_i(lc_ctrl_lc_seed_hw_rd_en), |
| 1308 | .lc_dft_en_i(lc_ctrl_lc_dft_en), |
| 1309 | .lc_check_byp_en_i(lc_ctrl_lc_check_byp_en), |
| 1310 | .otp_keymgr_key_o(otp_ctrl_otp_keymgr_key), |
| 1311 | .flash_otp_key_i(flash_ctrl_otp_req), |
| 1312 | .flash_otp_key_o(flash_ctrl_otp_rsp), |
| 1313 | .sram_otp_key_i(otp_ctrl_sram_otp_key_req), |
| 1314 | .sram_otp_key_o(otp_ctrl_sram_otp_key_rsp), |
| 1315 | .otbn_otp_key_i('0), |
| 1316 | .otbn_otp_key_o(), |
| 1317 | .otp_hw_cfg_o(otp_ctrl_otp_hw_cfg), |
| 1318 | .tl_i(otp_ctrl_tl_req), |
| 1319 | .tl_o(otp_ctrl_tl_rsp), |
| 1320 | |
| 1321 | // Clock and reset connections |
| 1322 | .clk_i (clkmgr_aon_clocks.clk_io_div4_timers), |
| 1323 | .clk_edn_i (clkmgr_aon_clocks.clk_main_timers), |
| 1324 | .rst_ni (rstmgr_aon_resets.rst_lc_io_div4_n[rstmgr_pkg::Domain0Sel]), |
| 1325 | .rst_edn_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
| 1326 | ); |
| 1327 | |
| 1328 | lc_ctrl #( |
| 1329 | .RndCnstLcKeymgrDivInvalid(RndCnstLcCtrlLcKeymgrDivInvalid), |
| 1330 | .RndCnstLcKeymgrDivTestDevRma(RndCnstLcCtrlLcKeymgrDivTestDevRma), |
| 1331 | .RndCnstLcKeymgrDivProduction(RndCnstLcCtrlLcKeymgrDivProduction) |
| 1332 | ) u_lc_ctrl ( |
| 1333 | |
| 1334 | // [2]: fatal_prog_error |
| 1335 | // [3]: fatal_state_error |
| 1336 | .alert_tx_o ( alert_tx[3:2] ), |
| 1337 | .alert_rx_i ( alert_rx[3:2] ), |
| 1338 | |
| 1339 | // Inter-module signals |
| 1340 | .jtag_i(jtag_pkg::JTAG_REQ_DEFAULT), |
| 1341 | .jtag_o(), |
| 1342 | .esc_wipe_secrets_tx_i(alert_handler_esc_tx[1]), |
| 1343 | .esc_wipe_secrets_rx_o(alert_handler_esc_rx[1]), |
| 1344 | .esc_scrap_state_tx_i(alert_handler_esc_tx[2]), |
| 1345 | .esc_scrap_state_rx_o(alert_handler_esc_rx[2]), |
| 1346 | .pwr_lc_i(pwrmgr_aon_pwr_lc_req), |
| 1347 | .pwr_lc_o(pwrmgr_aon_pwr_lc_rsp), |
| 1348 | .otp_lc_data_i(otp_ctrl_otp_lc_data), |
| 1349 | .lc_otp_program_o(lc_ctrl_lc_otp_program_req), |
| 1350 | .lc_otp_program_i(lc_ctrl_lc_otp_program_rsp), |
| 1351 | .lc_otp_token_o(lc_ctrl_lc_otp_token_req), |
| 1352 | .lc_otp_token_i(lc_ctrl_lc_otp_token_rsp), |
| 1353 | .lc_dft_en_o(lc_ctrl_lc_dft_en), |
| 1354 | .lc_nvm_debug_en_o(lc_ctrl_lc_nvm_debug_en), |
| 1355 | .lc_hw_debug_en_o(lc_ctrl_lc_hw_debug_en), |
| 1356 | .lc_cpu_en_o(lc_ctrl_lc_cpu_en), |
| 1357 | .lc_keymgr_en_o(), |
| 1358 | .lc_escalate_en_o(lc_ctrl_lc_escalate_en), |
| 1359 | .lc_clk_byp_req_o(lc_ctrl_lc_clk_byp_req), |
| 1360 | .lc_clk_byp_ack_i(lc_ctrl_lc_clk_byp_ack), |
| 1361 | .lc_flash_rma_req_o(flash_ctrl_rma_req), |
| 1362 | .lc_flash_rma_seed_o(flash_ctrl_rma_seed), |
| 1363 | .lc_flash_rma_ack_i(flash_ctrl_rma_ack), |
| 1364 | .lc_check_byp_en_o(lc_ctrl_lc_check_byp_en), |
| 1365 | .lc_creator_seed_sw_rw_en_o(lc_ctrl_lc_creator_seed_sw_rw_en), |
| 1366 | .lc_owner_seed_sw_rw_en_o(lc_ctrl_lc_owner_seed_sw_rw_en), |
| 1367 | .lc_iso_part_sw_rd_en_o(lc_ctrl_lc_iso_part_sw_rd_en), |
| 1368 | .lc_iso_part_sw_wr_en_o(lc_ctrl_lc_iso_part_sw_wr_en), |
| 1369 | .lc_seed_hw_rd_en_o(lc_ctrl_lc_seed_hw_rd_en), |
| 1370 | .lc_keymgr_div_o(lc_ctrl_lc_keymgr_div), |
| 1371 | .otp_hw_cfg_i(otp_ctrl_otp_hw_cfg), |
| 1372 | .tl_i(lc_ctrl_tl_req), |
| 1373 | .tl_o(lc_ctrl_tl_rsp), |
| 1374 | .scanmode_i (scanmode_i), |
| 1375 | |
| 1376 | // Clock and reset connections |
| 1377 | .clk_i (clkmgr_aon_clocks.clk_io_div4_timers), |
| 1378 | .rst_ni (rstmgr_aon_resets.rst_lc_io_div4_n[rstmgr_pkg::Domain0Sel]) |
| 1379 | ); |
| 1380 | |
| 1381 | alert_handler #( |
| 1382 | .RndCnstLfsrSeed(RndCnstAlertHandlerLfsrSeed), |
| 1383 | .RndCnstLfsrPerm(RndCnstAlertHandlerLfsrPerm) |
| 1384 | ) u_alert_handler ( |
| 1385 | |
| 1386 | // Interrupt |
| 1387 | .intr_classa_o (intr_alert_handler_classa), |
| 1388 | .intr_classb_o (intr_alert_handler_classb), |
| 1389 | .intr_classc_o (intr_alert_handler_classc), |
| 1390 | .intr_classd_o (intr_alert_handler_classd), |
| 1391 | |
| 1392 | // Inter-module signals |
| 1393 | .crashdump_o(alert_handler_crashdump), |
| 1394 | .entropy_i( 1'b0), |
| 1395 | .esc_rx_i(alert_handler_esc_rx), |
| 1396 | .esc_tx_o(alert_handler_esc_tx), |
| 1397 | .tl_i(alert_handler_tl_req), |
| 1398 | .tl_o(alert_handler_tl_rsp), |
| 1399 | // alert signals |
| 1400 | .alert_rx_o ( alert_rx ), |
| 1401 | .alert_tx_i ( alert_tx ), |
| 1402 | |
| 1403 | // Clock and reset connections |
| 1404 | .clk_i (clkmgr_aon_clocks.clk_io_div4_timers), |
| 1405 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
| 1406 | ); |
| 1407 | |
| 1408 | nmi_gen u_nmi_gen ( |
| 1409 | |
| 1410 | // Interrupt |
| 1411 | .intr_esc0_o (intr_nmi_gen_esc0), |
| 1412 | .intr_esc1_o (intr_nmi_gen_esc1), |
| 1413 | .intr_esc2_o (intr_nmi_gen_esc2), |
| 1414 | |
| 1415 | // Inter-module signals |
| 1416 | .nmi_rst_req_o(pwrmgr_aon_rstreqs), |
| 1417 | .esc_tx_i({3{prim_esc_pkg::ESC_TX_DEFAULT}}), |
| 1418 | .esc_rx_o(), |
| 1419 | .tl_i(nmi_gen_tl_req), |
| 1420 | .tl_o(nmi_gen_tl_rsp), |
| 1421 | |
| 1422 | // Clock and reset connections |
| 1423 | .clk_i (clkmgr_aon_clocks.clk_io_div4_timers), |
| 1424 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]) |
| 1425 | ); |
| 1426 | |
| 1427 | pwrmgr u_pwrmgr_aon ( |
| 1428 | |
| 1429 | // Interrupt |
| 1430 | .intr_wakeup_o (intr_pwrmgr_aon_wakeup), |
| 1431 | |
| 1432 | // Inter-module signals |
| 1433 | .pwr_ast_o(pwrmgr_ast_req_o), |
| 1434 | .pwr_ast_i(pwrmgr_ast_rsp_i), |
| 1435 | .pwr_rst_o(pwrmgr_aon_pwr_rst_req), |
| 1436 | .pwr_rst_i(pwrmgr_aon_pwr_rst_rsp), |
| 1437 | .pwr_clk_o(pwrmgr_aon_pwr_clk_req), |
| 1438 | .pwr_clk_i(pwrmgr_aon_pwr_clk_rsp), |
| 1439 | .pwr_otp_o(pwrmgr_aon_pwr_otp_req), |
| 1440 | .pwr_otp_i(pwrmgr_aon_pwr_otp_rsp), |
| 1441 | .pwr_lc_o(pwrmgr_aon_pwr_lc_req), |
| 1442 | .pwr_lc_i(pwrmgr_aon_pwr_lc_rsp), |
| 1443 | .pwr_flash_o(pwrmgr_aon_pwr_flash_req), |
| 1444 | .pwr_flash_i(pwrmgr_aon_pwr_flash_rsp), |
| 1445 | .esc_rst_tx_i(alert_handler_esc_tx[3]), |
| 1446 | .esc_rst_rx_o(alert_handler_esc_rx[3]), |
| 1447 | .pwr_cpu_i(pwrmgr_aon_pwr_cpu), |
| 1448 | .wakeups_i(pwrmgr_aon_wakeups), |
| 1449 | .rstreqs_i(pwrmgr_aon_rstreqs), |
| 1450 | .tl_i(pwrmgr_aon_tl_req), |
| 1451 | .tl_o(pwrmgr_aon_tl_rsp), |
| 1452 | |
| 1453 | // Clock and reset connections |
| 1454 | .clk_i (clkmgr_aon_clocks.clk_io_div4_powerup), |
| 1455 | .clk_slow_i (clkmgr_aon_clocks.clk_aon_powerup), |
| 1456 | .rst_ni (rstmgr_aon_resets.rst_por_n[rstmgr_pkg::DomainAonSel]), |
| 1457 | .rst_slow_ni (rstmgr_aon_resets.rst_por_aon_n[rstmgr_pkg::DomainAonSel]) |
| 1458 | ); |
| 1459 | |
| 1460 | rstmgr u_rstmgr_aon ( |
| 1461 | |
| 1462 | // Inter-module signals |
| 1463 | .pwr_i(pwrmgr_aon_pwr_rst_req), |
| 1464 | .pwr_o(pwrmgr_aon_pwr_rst_rsp), |
| 1465 | .resets_o(rstmgr_aon_resets), |
| 1466 | .ast_i(rstmgr_ast_i), |
| 1467 | .cpu_i(rstmgr_aon_cpu), |
| 1468 | .alert_dump_i(alert_handler_crashdump), |
| 1469 | .cpu_dump_i(rv_core_ibex_crashdump), |
| 1470 | .resets_ast_o(rsts_ast_o), |
| 1471 | .tl_i(rstmgr_aon_tl_req), |
| 1472 | .tl_o(rstmgr_aon_tl_rsp), |
| 1473 | .scanmode_i (scanmode_i), |
| 1474 | .scan_rst_ni (scan_rst_ni), |
| 1475 | |
| 1476 | // Clock and reset connections |
| 1477 | .clk_i (clkmgr_aon_clocks.clk_io_div4_powerup), |
| 1478 | .clk_aon_i (clkmgr_aon_clocks.clk_aon_powerup), |
| 1479 | .clk_main_i (clkmgr_aon_clocks.clk_main_powerup), |
| 1480 | .clk_io_i (clkmgr_aon_clocks.clk_io_powerup), |
| 1481 | .clk_usb_i (clkmgr_aon_clocks.clk_usb_powerup), |
| 1482 | .clk_io_div2_i (clkmgr_aon_clocks.clk_io_div2_powerup), |
| 1483 | .clk_io_div4_i (clkmgr_aon_clocks.clk_io_div4_powerup), |
| 1484 | .rst_ni (rst_ni) |
| 1485 | ); |
| 1486 | |
| 1487 | clkmgr u_clkmgr_aon ( |
| 1488 | |
| 1489 | // Inter-module signals |
| 1490 | .clocks_o(clkmgr_aon_clocks), |
| 1491 | .ast_clk_bypass_ack_i(lc_ctrl_pkg::LC_TX_DEFAULT), |
| 1492 | .lc_clk_bypass_ack_o(lc_ctrl_lc_clk_byp_ack), |
| 1493 | .clk_main_i(clk_main_i), |
| 1494 | .clk_io_i(clk_io_i), |
| 1495 | .clk_usb_i(clk_usb_i), |
| 1496 | .clk_aon_i(clk_aon_i), |
| 1497 | .clocks_ast_o(clks_ast_o), |
| 1498 | .pwr_i(pwrmgr_aon_pwr_clk_req), |
| 1499 | .pwr_o(pwrmgr_aon_pwr_clk_rsp), |
| 1500 | .idle_i(clkmgr_aon_idle), |
| 1501 | .tl_i(clkmgr_aon_tl_req), |
| 1502 | .tl_o(clkmgr_aon_tl_rsp), |
| 1503 | .scanmode_i (scanmode_i), |
| 1504 | |
| 1505 | // Clock and reset connections |
| 1506 | .clk_i (clkmgr_aon_clocks.clk_io_div4_powerup), |
| 1507 | .rst_ni (rstmgr_aon_resets.rst_por_io_div4_n[rstmgr_pkg::DomainAonSel]), |
| 1508 | .rst_main_ni (rstmgr_aon_resets.rst_por_n[rstmgr_pkg::DomainAonSel]), |
| 1509 | .rst_io_ni (rstmgr_aon_resets.rst_por_io_n[rstmgr_pkg::DomainAonSel]), |
| 1510 | .rst_usb_ni (rstmgr_aon_resets.rst_por_usb_n[rstmgr_pkg::DomainAonSel]), |
| 1511 | .rst_io_div2_ni (rstmgr_aon_resets.rst_por_io_div2_n[rstmgr_pkg::DomainAonSel]), |
| 1512 | .rst_io_div4_ni (rstmgr_aon_resets.rst_por_io_div4_n[rstmgr_pkg::DomainAonSel]) |
| 1513 | ); |
| 1514 | |
| 1515 | pinmux u_pinmux_aon ( |
| 1516 | |
| 1517 | // Inter-module signals |
| 1518 | .lc_pinmux_strap_i('0), |
| 1519 | .lc_pinmux_strap_o(), |
| 1520 | .dft_strap_test_o(), |
| 1521 | .io_pok_i({pinmux_pkg::NIOPokSignals{1'b1}}), |
| 1522 | .sleep_en_i(1'b0), |
Timothy Chen | bea7b6a | 2021-01-21 13:59:20 -0800 | [diff] [blame] | 1523 | .aon_wkup_req_o(pwrmgr_aon_wakeups[0]), |
| 1524 | .usb_wkup_req_o(pwrmgr_aon_wakeups[1]), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1525 | .usb_out_of_rst_i(usbdev_usb_out_of_rst), |
| 1526 | .usb_aon_wake_en_i(usbdev_usb_aon_wake_en), |
| 1527 | .usb_aon_wake_ack_i(usbdev_usb_aon_wake_ack), |
| 1528 | .usb_suspend_i(usbdev_usb_suspend), |
| 1529 | .usb_state_debug_o(pinmux_aon_usb_state_debug), |
| 1530 | .tl_i(pinmux_aon_tl_req), |
| 1531 | .tl_o(pinmux_aon_tl_rsp), |
| 1532 | |
| 1533 | .periph_to_mio_i (mio_d2p ), |
| 1534 | .periph_to_mio_oe_i (mio_d2p_en ), |
| 1535 | .mio_to_periph_o (mio_p2d ), |
| 1536 | |
| 1537 | .mio_out_o, |
| 1538 | .mio_oe_o, |
| 1539 | .mio_in_i, |
| 1540 | |
| 1541 | .periph_to_dio_i (dio_d2p ), |
| 1542 | .periph_to_dio_oe_i (dio_d2p_en ), |
| 1543 | .dio_to_periph_o (dio_p2d ), |
| 1544 | |
| 1545 | .dio_out_o, |
| 1546 | .dio_oe_o, |
| 1547 | .dio_in_i, |
| 1548 | |
| 1549 | // Clock and reset connections |
| 1550 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 1551 | .clk_aon_i (clkmgr_aon_clocks.clk_aon_secure), |
| 1552 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::DomainAonSel]), |
| 1553 | .rst_aon_ni (rstmgr_aon_resets.rst_sys_aon_n[rstmgr_pkg::DomainAonSel]) |
| 1554 | ); |
| 1555 | |
| 1556 | padctrl u_padctrl_aon ( |
| 1557 | |
| 1558 | // Inter-module signals |
| 1559 | .tl_i(padctrl_aon_tl_req), |
| 1560 | .tl_o(padctrl_aon_tl_rsp), |
| 1561 | |
| 1562 | .mio_attr_o, |
| 1563 | .dio_attr_o, |
| 1564 | |
| 1565 | // Clock and reset connections |
| 1566 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 1567 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::DomainAonSel]) |
| 1568 | ); |
| 1569 | |
| 1570 | sensor_ctrl u_sensor_ctrl_aon ( |
| 1571 | |
| 1572 | // [4]: recov_as |
| 1573 | // [5]: recov_cg |
| 1574 | // [6]: recov_gd |
| 1575 | // [7]: recov_ts_hi |
| 1576 | // [8]: recov_ts_lo |
| 1577 | // [9]: recov_ls |
| 1578 | // [10]: recov_ot |
| 1579 | .alert_tx_o ( alert_tx[10:4] ), |
| 1580 | .alert_rx_i ( alert_rx[10:4] ), |
| 1581 | |
| 1582 | // Inter-module signals |
| 1583 | .ast_alert_i(sensor_ctrl_ast_alert_req_i), |
| 1584 | .ast_alert_o(sensor_ctrl_ast_alert_rsp_o), |
| 1585 | .ast_status_i(sensor_ctrl_ast_status_i), |
| 1586 | .tl_i(sensor_ctrl_aon_tl_req), |
| 1587 | .tl_o(sensor_ctrl_aon_tl_rsp), |
| 1588 | |
| 1589 | // Clock and reset connections |
| 1590 | .clk_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 1591 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::DomainAonSel]) |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 1592 | ); |
| 1593 | |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1594 | sram_ctrl #( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1595 | .RndCnstSramKey(RndCnstSramCtrlRetAonSramKey), |
| 1596 | .RndCnstSramNonce(RndCnstSramCtrlRetAonSramNonce) |
| 1597 | ) u_sram_ctrl_ret_aon ( |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1598 | |
Michael Schaffner | 814229a | 2021-01-20 14:47:03 -0800 | [diff] [blame] | 1599 | // [11]: fatal_parity_error |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1600 | .alert_tx_o ( alert_tx[11:11] ), |
| 1601 | .alert_rx_i ( alert_rx[11:11] ), |
| 1602 | |
| 1603 | // Inter-module signals |
| 1604 | .sram_otp_key_o(otp_ctrl_sram_otp_key_req[1]), |
| 1605 | .sram_otp_key_i(otp_ctrl_sram_otp_key_rsp[1]), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1606 | .sram_scr_o(sram_ctrl_ret_aon_sram_scr_req), |
| 1607 | .sram_scr_i(sram_ctrl_ret_aon_sram_scr_rsp), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1608 | .lc_escalate_en_i(lc_ctrl_lc_escalate_en), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1609 | .tl_i(sram_ctrl_ret_aon_tl_req), |
| 1610 | .tl_o(sram_ctrl_ret_aon_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1611 | |
| 1612 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1613 | .clk_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1614 | .clk_otp_i (clkmgr_aon_clocks.clk_io_div4_peri), |
| 1615 | .rst_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::DomainAonSel]), |
| 1616 | .rst_otp_ni (rstmgr_aon_resets.rst_lc_io_div4_n[rstmgr_pkg::DomainAonSel]) |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1617 | ); |
| 1618 | |
Timothy Chen | ccf343d | 2020-12-04 20:38:15 -0800 | [diff] [blame] | 1619 | flash_ctrl #( |
| 1620 | .RndCnstAddrKey(RndCnstFlashCtrlAddrKey), |
Timothy Chen | 24b6279 | 2020-12-11 15:09:05 -0800 | [diff] [blame] | 1621 | .RndCnstDataKey(RndCnstFlashCtrlDataKey), |
| 1622 | .RndCnstLfsrSeed(RndCnstFlashCtrlLfsrSeed), |
| 1623 | .RndCnstLfsrPerm(RndCnstFlashCtrlLfsrPerm) |
Timothy Chen | ccf343d | 2020-12-04 20:38:15 -0800 | [diff] [blame] | 1624 | ) u_flash_ctrl ( |
Timothy Chen | 1555dce | 2020-08-11 11:26:50 -0700 | [diff] [blame] | 1625 | |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1626 | // Interrupt |
| 1627 | .intr_prog_empty_o (intr_flash_ctrl_prog_empty), |
| 1628 | .intr_prog_lvl_o (intr_flash_ctrl_prog_lvl), |
| 1629 | .intr_rd_full_o (intr_flash_ctrl_rd_full), |
| 1630 | .intr_rd_lvl_o (intr_flash_ctrl_rd_lvl), |
| 1631 | .intr_op_done_o (intr_flash_ctrl_op_done), |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 1632 | |
| 1633 | // [12]: recov_err |
| 1634 | // [13]: recov_mp_err |
| 1635 | // [14]: recov_ecc_err |
| 1636 | .alert_tx_o ( alert_tx[14:12] ), |
| 1637 | .alert_rx_i ( alert_rx[14:12] ), |
Timothy Chen | 1555dce | 2020-08-11 11:26:50 -0700 | [diff] [blame] | 1638 | |
| 1639 | // Inter-module signals |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1640 | .flash_o(flash_ctrl_flash_req), |
| 1641 | .flash_i(flash_ctrl_flash_rsp), |
Timothy Chen | ccf343d | 2020-12-04 20:38:15 -0800 | [diff] [blame] | 1642 | .otp_o(flash_ctrl_otp_req), |
| 1643 | .otp_i(flash_ctrl_otp_rsp), |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 1644 | .lc_creator_seed_sw_rw_en_i(lc_ctrl_lc_creator_seed_sw_rw_en), |
| 1645 | .lc_owner_seed_sw_rw_en_i(lc_ctrl_lc_owner_seed_sw_rw_en), |
| 1646 | .lc_iso_part_sw_rd_en_i(lc_ctrl_lc_iso_part_sw_rd_en), |
| 1647 | .lc_iso_part_sw_wr_en_i(lc_ctrl_lc_iso_part_sw_wr_en), |
| 1648 | .lc_seed_hw_rd_en_i(lc_ctrl_lc_seed_hw_rd_en), |
Timothy Chen | 3cb138f | 2020-12-15 20:35:03 -0800 | [diff] [blame] | 1649 | .rma_req_i(flash_ctrl_rma_req), |
| 1650 | .rma_ack_o(flash_ctrl_rma_ack), |
| 1651 | .rma_seed_i(flash_ctrl_rma_seed), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1652 | .pwrmgr_i(pwrmgr_aon_pwr_flash_req), |
| 1653 | .pwrmgr_o(pwrmgr_aon_pwr_flash_rsp), |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1654 | .keymgr_o(flash_ctrl_keymgr), |
| 1655 | .tl_i(flash_ctrl_tl_req), |
| 1656 | .tl_o(flash_ctrl_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1657 | |
| 1658 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1659 | .clk_i (clkmgr_aon_clocks.clk_main_infra), |
| 1660 | .clk_otp_i (clkmgr_aon_clocks.clk_io_div4_infra), |
| 1661 | .rst_ni (rstmgr_aon_resets.rst_lc_n[rstmgr_pkg::Domain0Sel]), |
| 1662 | .rst_otp_ni (rstmgr_aon_resets.rst_lc_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1663 | ); |
| 1664 | |
| 1665 | rv_plic u_rv_plic ( |
| 1666 | |
| 1667 | // Inter-module signals |
| 1668 | .tl_i(rv_plic_tl_req), |
| 1669 | .tl_o(rv_plic_tl_rsp), |
| 1670 | |
| 1671 | .intr_src_i (intr_vector), |
| 1672 | .irq_o (irq_plic), |
| 1673 | .irq_id_o (irq_id), |
| 1674 | .msip_o (msip), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1675 | |
| 1676 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1677 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1678 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1679 | ); |
| 1680 | |
| 1681 | aes #( |
| 1682 | .AES192Enable(1'b1), |
| 1683 | .Masking(AesMasking), |
| 1684 | .SBoxImpl(AesSBoxImpl), |
| 1685 | .SecStartTriggerDelay(SecAesStartTriggerDelay), |
| 1686 | .SecAllowForcingMasks(SecAesAllowForcingMasks), |
Pirmin Vogel | 62f79b8 | 2020-12-08 11:58:48 +0100 | [diff] [blame] | 1687 | .AlertAsyncOn({aes_reg_pkg::NumAlerts{1'b1}}), |
| 1688 | .RndCnstClearingLfsrSeed(aes_pkg::RndCnstClearingLfsrSeedDefault), |
| 1689 | .RndCnstClearingLfsrPerm(aes_pkg::RndCnstClearingLfsrPermDefault), |
| 1690 | .RndCnstMaskingLfsrSeed(aes_pkg::RndCnstMaskingLfsrSeedDefault), |
| 1691 | .RndCnstMskgChunkLfsrPerm(aes_pkg::RndCnstMskgChunkLfsrPermDefault) |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1692 | ) u_aes ( |
| 1693 | |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 1694 | // [15]: recov_ctrl_update_err |
| 1695 | // [16]: fatal_fault |
| 1696 | .alert_tx_o ( alert_tx[16:15] ), |
| 1697 | .alert_rx_i ( alert_rx[16:15] ), |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1698 | |
| 1699 | // Inter-module signals |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1700 | .idle_o(clkmgr_aon_idle[0]), |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1701 | .tl_i(aes_tl_req), |
| 1702 | .tl_o(aes_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1703 | |
| 1704 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1705 | .clk_i (clkmgr_aon_clocks.clk_main_aes), |
| 1706 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1707 | ); |
| 1708 | |
| 1709 | hmac u_hmac ( |
| 1710 | |
| 1711 | // Interrupt |
| 1712 | .intr_hmac_done_o (intr_hmac_hmac_done), |
| 1713 | .intr_fifo_empty_o (intr_hmac_fifo_empty), |
| 1714 | .intr_hmac_err_o (intr_hmac_hmac_err), |
| 1715 | |
| 1716 | // Inter-module signals |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1717 | .idle_o(clkmgr_aon_idle[1]), |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1718 | .tl_i(hmac_tl_req), |
| 1719 | .tl_o(hmac_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1720 | |
| 1721 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1722 | .clk_i (clkmgr_aon_clocks.clk_main_hmac), |
| 1723 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1724 | ); |
| 1725 | |
| 1726 | kmac #( |
| 1727 | .EnMasking(KmacEnMasking), |
| 1728 | .ReuseShare(KmacReuseShare) |
| 1729 | ) u_kmac ( |
| 1730 | |
| 1731 | // Interrupt |
| 1732 | .intr_kmac_done_o (intr_kmac_kmac_done), |
| 1733 | .intr_fifo_empty_o (intr_kmac_fifo_empty), |
| 1734 | .intr_kmac_err_o (intr_kmac_kmac_err), |
| 1735 | |
| 1736 | // Inter-module signals |
| 1737 | .keymgr_key_i(keymgr_kmac_key), |
| 1738 | .keymgr_kdf_i(keymgr_kmac_data_req), |
| 1739 | .keymgr_kdf_o(keymgr_kmac_data_rsp), |
Eunchan Kim | 059134b | 2020-12-02 12:29:48 -0800 | [diff] [blame] | 1740 | .entropy_o(), |
| 1741 | .entropy_i(edn_pkg::EDN_RSP_DEFAULT), |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1742 | .idle_o(clkmgr_aon_idle[2]), |
Martin Lueker-Boden | d5a1e4b | 2020-11-11 19:46:33 -0800 | [diff] [blame] | 1743 | .tl_i(kmac_tl_req), |
| 1744 | .tl_o(kmac_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1745 | |
| 1746 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1747 | .clk_i (clkmgr_aon_clocks.clk_main_kmac), |
| 1748 | .clk_edn_i (clkmgr_aon_clocks.clk_main_kmac), |
| 1749 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
| 1750 | .rst_edn_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 1555dce | 2020-08-11 11:26:50 -0700 | [diff] [blame] | 1751 | ); |
| 1752 | |
Timothy Chen | f9169fa | 2020-12-04 18:08:45 -0800 | [diff] [blame] | 1753 | keymgr #( |
| 1754 | .RndCnstLfsrSeed(RndCnstKeymgrLfsrSeed), |
| 1755 | .RndCnstLfsrPerm(RndCnstKeymgrLfsrPerm), |
Timothy Chen | be2da9e | 2021-01-07 18:29:01 -0800 | [diff] [blame] | 1756 | .RndCnstRandPerm(RndCnstKeymgrRandPerm), |
Timothy Chen | f9169fa | 2020-12-04 18:08:45 -0800 | [diff] [blame] | 1757 | .RndCnstRevisionSeed(RndCnstKeymgrRevisionSeed), |
| 1758 | .RndCnstCreatorIdentitySeed(RndCnstKeymgrCreatorIdentitySeed), |
| 1759 | .RndCnstOwnerIntIdentitySeed(RndCnstKeymgrOwnerIntIdentitySeed), |
| 1760 | .RndCnstOwnerIdentitySeed(RndCnstKeymgrOwnerIdentitySeed), |
| 1761 | .RndCnstSoftOutputSeed(RndCnstKeymgrSoftOutputSeed), |
Timothy Chen | 51c8546 | 2020-12-10 16:36:02 -0800 | [diff] [blame] | 1762 | .RndCnstHardOutputSeed(RndCnstKeymgrHardOutputSeed), |
| 1763 | .RndCnstAesSeed(RndCnstKeymgrAesSeed), |
| 1764 | .RndCnstHmacSeed(RndCnstKeymgrHmacSeed), |
| 1765 | .RndCnstKmacSeed(RndCnstKeymgrKmacSeed), |
| 1766 | .RndCnstNoneSeed(RndCnstKeymgrNoneSeed) |
Timothy Chen | f9169fa | 2020-12-04 18:08:45 -0800 | [diff] [blame] | 1767 | ) u_keymgr ( |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1768 | |
| 1769 | // Interrupt |
| 1770 | .intr_op_done_o (intr_keymgr_op_done), |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1771 | |
Michael Schaffner | 4908b1b | 2021-02-02 13:26:17 -0800 | [diff] [blame] | 1772 | // [17]: fatal_fault_err |
| 1773 | // [18]: recov_operation_err |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 1774 | .alert_tx_o ( alert_tx[18:17] ), |
| 1775 | .alert_rx_i ( alert_rx[18:17] ), |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1776 | |
| 1777 | // Inter-module signals |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 1778 | .edn_o(edn0_edn_req[0]), |
| 1779 | .edn_i(edn0_edn_rsp[0]), |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1780 | .aes_key_o(), |
| 1781 | .hmac_key_o(), |
Eunchan Kim | e5d33b7 | 2020-11-03 14:34:16 -0800 | [diff] [blame] | 1782 | .kmac_key_o(keymgr_kmac_key), |
| 1783 | .kmac_data_o(keymgr_kmac_data_req), |
| 1784 | .kmac_data_i(keymgr_kmac_data_rsp), |
Timothy Chen | 77cc8b9 | 2020-12-05 09:19:14 -0800 | [diff] [blame] | 1785 | .otp_key_i(otp_ctrl_otp_keymgr_key), |
Timothy Chen | 6ace8f3 | 2020-12-14 17:26:56 -0800 | [diff] [blame] | 1786 | .otp_hw_cfg_i(otp_ctrl_otp_hw_cfg), |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1787 | .flash_i(flash_ctrl_keymgr), |
Timothy Chen | 6ace8f3 | 2020-12-14 17:26:56 -0800 | [diff] [blame] | 1788 | .lc_keymgr_en_i(lc_ctrl_pkg::On), |
| 1789 | .lc_keymgr_div_i(lc_ctrl_lc_keymgr_div), |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1790 | .tl_i(keymgr_tl_req), |
| 1791 | .tl_o(keymgr_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1792 | |
| 1793 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1794 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1795 | .clk_edn_i (clkmgr_aon_clocks.clk_main_secure), |
| 1796 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
| 1797 | .rst_edn_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1798 | ); |
| 1799 | |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1800 | csrng #( |
| 1801 | .SBoxImpl(CsrngSBoxImpl) |
| 1802 | ) u_csrng ( |
| 1803 | |
| 1804 | // Interrupt |
| 1805 | .intr_cs_cmd_req_done_o (intr_csrng_cs_cmd_req_done), |
| 1806 | .intr_cs_entropy_req_o (intr_csrng_cs_entropy_req), |
| 1807 | .intr_cs_hw_inst_exc_o (intr_csrng_cs_hw_inst_exc), |
| 1808 | .intr_cs_fifo_err_o (intr_csrng_cs_fifo_err), |
| 1809 | |
| 1810 | // Inter-module signals |
| 1811 | .csrng_cmd_i(csrng_csrng_cmd_req), |
| 1812 | .csrng_cmd_o(csrng_csrng_cmd_rsp), |
| 1813 | .entropy_src_hw_if_o(csrng_entropy_src_hw_if_req), |
| 1814 | .entropy_src_hw_if_i(csrng_entropy_src_hw_if_rsp), |
| 1815 | .efuse_sw_app_enable_i('0), |
Mark Branstad | 1c3b160 | 2020-12-11 15:09:10 -0800 | [diff] [blame] | 1816 | .lc_hw_debug_en_i(lc_ctrl_pkg::Off), |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1817 | .tl_i(csrng_tl_req), |
| 1818 | .tl_o(csrng_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1819 | |
| 1820 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1821 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1822 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1823 | ); |
| 1824 | |
| 1825 | entropy_src u_entropy_src ( |
| 1826 | |
| 1827 | // Interrupt |
| 1828 | .intr_es_entropy_valid_o (intr_entropy_src_es_entropy_valid), |
| 1829 | .intr_es_health_test_failed_o (intr_entropy_src_es_health_test_failed), |
| 1830 | .intr_es_fifo_err_o (intr_entropy_src_es_fifo_err), |
| 1831 | |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 1832 | // [19]: recov_alert_count_met |
| 1833 | .alert_tx_o ( alert_tx[19:19] ), |
| 1834 | .alert_rx_i ( alert_rx[19:19] ), |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1835 | |
| 1836 | // Inter-module signals |
| 1837 | .entropy_src_hw_if_i(csrng_entropy_src_hw_if_req), |
| 1838 | .entropy_src_hw_if_o(csrng_entropy_src_hw_if_rsp), |
| 1839 | .entropy_src_rng_o(), |
| 1840 | .entropy_src_rng_i(entropy_src_pkg::ENTROPY_SRC_RNG_RSP_DEFAULT), |
| 1841 | .entropy_src_xht_o(), |
| 1842 | .entropy_src_xht_i(entropy_src_pkg::ENTROPY_SRC_XHT_RSP_DEFAULT), |
| 1843 | .efuse_es_sw_reg_en_i('0), |
| 1844 | .tl_i(entropy_src_tl_req), |
| 1845 | .tl_o(entropy_src_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1846 | |
| 1847 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1848 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1849 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1850 | ); |
| 1851 | |
| 1852 | edn u_edn0 ( |
| 1853 | |
| 1854 | // Interrupt |
| 1855 | .intr_edn_cmd_req_done_o (intr_edn0_edn_cmd_req_done), |
| 1856 | .intr_edn_fifo_err_o (intr_edn0_edn_fifo_err), |
| 1857 | |
| 1858 | // Inter-module signals |
| 1859 | .csrng_cmd_o(csrng_csrng_cmd_req[0]), |
| 1860 | .csrng_cmd_i(csrng_csrng_cmd_rsp[0]), |
Timothy Chen | 90b8242 | 2021-02-03 23:45:21 -0800 | [diff] [blame] | 1861 | .edn_i(edn0_edn_req), |
| 1862 | .edn_o(edn0_edn_rsp), |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1863 | .tl_i(edn0_tl_req), |
| 1864 | .tl_o(edn0_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1865 | |
| 1866 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1867 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1868 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1869 | ); |
| 1870 | |
| 1871 | edn u_edn1 ( |
| 1872 | |
| 1873 | // Interrupt |
| 1874 | .intr_edn_cmd_req_done_o (intr_edn1_edn_cmd_req_done), |
| 1875 | .intr_edn_fifo_err_o (intr_edn1_edn_fifo_err), |
| 1876 | |
| 1877 | // Inter-module signals |
| 1878 | .csrng_cmd_o(csrng_csrng_cmd_req[1]), |
| 1879 | .csrng_cmd_i(csrng_csrng_cmd_rsp[1]), |
Michael Schaffner | 7826935 | 2021-02-02 17:51:28 -0800 | [diff] [blame] | 1880 | .edn_i('0), |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1881 | .edn_o(), |
| 1882 | .tl_i(edn1_tl_req), |
| 1883 | .tl_o(edn1_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1884 | |
| 1885 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1886 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1887 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 1888 | ); |
| 1889 | |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1890 | sram_ctrl #( |
| 1891 | .RndCnstSramKey(RndCnstSramCtrlMainSramKey), |
| 1892 | .RndCnstSramNonce(RndCnstSramCtrlMainSramNonce) |
| 1893 | ) u_sram_ctrl_main ( |
| 1894 | |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 1895 | // [20]: fatal_parity_error |
| 1896 | .alert_tx_o ( alert_tx[20:20] ), |
| 1897 | .alert_rx_i ( alert_rx[20:20] ), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1898 | |
| 1899 | // Inter-module signals |
| 1900 | .sram_otp_key_o(otp_ctrl_sram_otp_key_req[0]), |
| 1901 | .sram_otp_key_i(otp_ctrl_sram_otp_key_rsp[0]), |
| 1902 | .sram_scr_o(sram_ctrl_main_sram_scr_req), |
| 1903 | .sram_scr_i(sram_ctrl_main_sram_scr_rsp), |
| 1904 | .lc_escalate_en_i(lc_ctrl_lc_escalate_en), |
| 1905 | .tl_i(sram_ctrl_main_tl_req), |
| 1906 | .tl_o(sram_ctrl_main_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1907 | |
| 1908 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1909 | .clk_i (clkmgr_aon_clocks.clk_main_secure), |
| 1910 | .clk_otp_i (clkmgr_aon_clocks.clk_io_div4_secure), |
| 1911 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
| 1912 | .rst_otp_ni (rstmgr_aon_resets.rst_lc_io_div4_n[rstmgr_pkg::Domain0Sel]) |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 1913 | ); |
| 1914 | |
Pirmin Vogel | 69b55a8 | 2020-10-01 09:54:39 +0200 | [diff] [blame] | 1915 | otbn #( |
| 1916 | .RegFile(OtbnRegFile) |
| 1917 | ) u_otbn ( |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 1918 | |
| 1919 | // Interrupt |
| 1920 | .intr_done_o (intr_otbn_done), |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 1921 | |
Timothy Chen | d39fd39 | 2021-01-15 21:29:36 -0800 | [diff] [blame] | 1922 | // [21]: fatal |
| 1923 | // [22]: recov |
| 1924 | .alert_tx_o ( alert_tx[22:21] ), |
| 1925 | .alert_rx_i ( alert_rx[22:21] ), |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 1926 | |
| 1927 | // Inter-module signals |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1928 | .idle_o(clkmgr_aon_idle[3]), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 1929 | .tl_i(otbn_tl_req), |
| 1930 | .tl_o(otbn_tl_rsp), |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1931 | |
| 1932 | // Clock and reset connections |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1933 | .clk_i (clkmgr_aon_clocks.clk_main_otbn), |
| 1934 | .rst_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]) |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 1935 | ); |
| 1936 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1937 | // interrupt assignments |
| 1938 | assign intr_vector = { |
Timothy Chen | f2be43c | 2020-12-17 18:50:47 -0800 | [diff] [blame] | 1939 | intr_entropy_src_es_fifo_err, |
| 1940 | intr_entropy_src_es_health_test_failed, |
| 1941 | intr_entropy_src_es_entropy_valid, |
| 1942 | intr_edn1_edn_fifo_err, |
| 1943 | intr_edn1_edn_cmd_req_done, |
| 1944 | intr_edn0_edn_fifo_err, |
| 1945 | intr_edn0_edn_cmd_req_done, |
| 1946 | intr_csrng_cs_fifo_err, |
| 1947 | intr_csrng_cs_hw_inst_exc, |
| 1948 | intr_csrng_cs_entropy_req, |
| 1949 | intr_csrng_cs_cmd_req_done, |
| 1950 | intr_otp_ctrl_otp_error, |
| 1951 | intr_otp_ctrl_otp_operation_done, |
Eunchan Kim | e5d33b7 | 2020-11-03 14:34:16 -0800 | [diff] [blame] | 1952 | intr_kmac_kmac_err, |
| 1953 | intr_kmac_fifo_empty, |
| 1954 | intr_kmac_kmac_done, |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 1955 | intr_keymgr_op_done, |
Philipp Wagner | a4a9e40 | 2020-06-22 12:06:56 +0100 | [diff] [blame] | 1956 | intr_otbn_done, |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 1957 | intr_pwrmgr_aon_wakeup, |
Stefan Lippuner | 207b1a6 | 2020-11-10 09:25:53 +0100 | [diff] [blame] | 1958 | intr_usbdev_link_out_err, |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 1959 | intr_usbdev_connected, |
| 1960 | intr_usbdev_frame, |
| 1961 | intr_usbdev_rx_bitstuff_err, |
| 1962 | intr_usbdev_rx_pid_err, |
| 1963 | intr_usbdev_rx_crc_err, |
| 1964 | intr_usbdev_link_in_err, |
| 1965 | intr_usbdev_av_overflow, |
| 1966 | intr_usbdev_rx_full, |
| 1967 | intr_usbdev_av_empty, |
| 1968 | intr_usbdev_link_resume, |
| 1969 | intr_usbdev_link_suspend, |
| 1970 | intr_usbdev_link_reset, |
| 1971 | intr_usbdev_host_lost, |
| 1972 | intr_usbdev_disconnected, |
| 1973 | intr_usbdev_pkt_sent, |
| 1974 | intr_usbdev_pkt_received, |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 1975 | intr_nmi_gen_esc2, |
| 1976 | intr_nmi_gen_esc1, |
| 1977 | intr_nmi_gen_esc0, |
| 1978 | intr_alert_handler_classd, |
| 1979 | intr_alert_handler_classc, |
| 1980 | intr_alert_handler_classb, |
| 1981 | intr_alert_handler_classa, |
Eunchan Kim | 226eab6 | 2019-10-18 14:11:29 -0700 | [diff] [blame] | 1982 | intr_hmac_hmac_err, |
Eunchan Kim | d9d69aa | 2020-03-20 10:21:11 -0700 | [diff] [blame] | 1983 | intr_hmac_fifo_empty, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1984 | intr_hmac_hmac_done, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1985 | intr_flash_ctrl_op_done, |
| 1986 | intr_flash_ctrl_rd_lvl, |
| 1987 | intr_flash_ctrl_rd_full, |
| 1988 | intr_flash_ctrl_prog_lvl, |
| 1989 | intr_flash_ctrl_prog_empty, |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 1990 | intr_pattgen_done_ch1, |
| 1991 | intr_pattgen_done_ch0, |
| 1992 | intr_i2c2_host_timeout, |
| 1993 | intr_i2c2_ack_stop, |
| 1994 | intr_i2c2_acq_overflow, |
| 1995 | intr_i2c2_tx_overflow, |
| 1996 | intr_i2c2_tx_nonempty, |
| 1997 | intr_i2c2_tx_empty, |
| 1998 | intr_i2c2_trans_complete, |
| 1999 | intr_i2c2_sda_unstable, |
| 2000 | intr_i2c2_stretch_timeout, |
| 2001 | intr_i2c2_sda_interference, |
| 2002 | intr_i2c2_scl_interference, |
| 2003 | intr_i2c2_nak, |
| 2004 | intr_i2c2_rx_overflow, |
| 2005 | intr_i2c2_fmt_overflow, |
| 2006 | intr_i2c2_rx_watermark, |
| 2007 | intr_i2c2_fmt_watermark, |
| 2008 | intr_i2c1_host_timeout, |
| 2009 | intr_i2c1_ack_stop, |
| 2010 | intr_i2c1_acq_overflow, |
| 2011 | intr_i2c1_tx_overflow, |
| 2012 | intr_i2c1_tx_nonempty, |
| 2013 | intr_i2c1_tx_empty, |
| 2014 | intr_i2c1_trans_complete, |
| 2015 | intr_i2c1_sda_unstable, |
| 2016 | intr_i2c1_stretch_timeout, |
| 2017 | intr_i2c1_sda_interference, |
| 2018 | intr_i2c1_scl_interference, |
| 2019 | intr_i2c1_nak, |
| 2020 | intr_i2c1_rx_overflow, |
| 2021 | intr_i2c1_fmt_overflow, |
| 2022 | intr_i2c1_rx_watermark, |
| 2023 | intr_i2c1_fmt_watermark, |
| 2024 | intr_i2c0_host_timeout, |
| 2025 | intr_i2c0_ack_stop, |
| 2026 | intr_i2c0_acq_overflow, |
| 2027 | intr_i2c0_tx_overflow, |
| 2028 | intr_i2c0_tx_nonempty, |
| 2029 | intr_i2c0_tx_empty, |
| 2030 | intr_i2c0_trans_complete, |
| 2031 | intr_i2c0_sda_unstable, |
| 2032 | intr_i2c0_stretch_timeout, |
| 2033 | intr_i2c0_sda_interference, |
| 2034 | intr_i2c0_scl_interference, |
| 2035 | intr_i2c0_nak, |
| 2036 | intr_i2c0_rx_overflow, |
| 2037 | intr_i2c0_fmt_overflow, |
| 2038 | intr_i2c0_rx_watermark, |
| 2039 | intr_i2c0_fmt_watermark, |
Eunchan Kim | 546c0d4 | 2019-09-24 15:07:06 -0700 | [diff] [blame] | 2040 | intr_spi_device_txunderflow, |
| 2041 | intr_spi_device_rxoverflow, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2042 | intr_spi_device_rxerr, |
| 2043 | intr_spi_device_txlvl, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2044 | intr_spi_device_rxlvl, |
Eunchan Kim | 8c57fe3 | 2019-09-02 21:14:24 -0700 | [diff] [blame] | 2045 | intr_spi_device_rxf, |
Eunchan Kim | 88a8615 | 2020-04-13 16:12:08 -0700 | [diff] [blame] | 2046 | intr_gpio_gpio, |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2047 | intr_uart3_rx_parity_err, |
| 2048 | intr_uart3_rx_timeout, |
| 2049 | intr_uart3_rx_break_err, |
| 2050 | intr_uart3_rx_frame_err, |
| 2051 | intr_uart3_rx_overflow, |
| 2052 | intr_uart3_tx_empty, |
| 2053 | intr_uart3_rx_watermark, |
| 2054 | intr_uart3_tx_watermark, |
| 2055 | intr_uart2_rx_parity_err, |
| 2056 | intr_uart2_rx_timeout, |
| 2057 | intr_uart2_rx_break_err, |
| 2058 | intr_uart2_rx_frame_err, |
| 2059 | intr_uart2_rx_overflow, |
| 2060 | intr_uart2_tx_empty, |
| 2061 | intr_uart2_rx_watermark, |
| 2062 | intr_uart2_tx_watermark, |
| 2063 | intr_uart1_rx_parity_err, |
| 2064 | intr_uart1_rx_timeout, |
| 2065 | intr_uart1_rx_break_err, |
| 2066 | intr_uart1_rx_frame_err, |
| 2067 | intr_uart1_rx_overflow, |
| 2068 | intr_uart1_tx_empty, |
| 2069 | intr_uart1_rx_watermark, |
| 2070 | intr_uart1_tx_watermark, |
| 2071 | intr_uart0_rx_parity_err, |
| 2072 | intr_uart0_rx_timeout, |
| 2073 | intr_uart0_rx_break_err, |
| 2074 | intr_uart0_rx_frame_err, |
| 2075 | intr_uart0_rx_overflow, |
| 2076 | intr_uart0_tx_empty, |
| 2077 | intr_uart0_rx_watermark, |
| 2078 | intr_uart0_tx_watermark, |
Eunchan Kim | 88a8615 | 2020-04-13 16:12:08 -0700 | [diff] [blame] | 2079 | 1'b 0 // For ID 0. |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2080 | }; |
| 2081 | |
| 2082 | // TL-UL Crossbar |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2083 | xbar_main u_xbar_main ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2084 | .clk_main_i (clkmgr_aon_clocks.clk_main_infra), |
| 2085 | .clk_fixed_i (clkmgr_aon_clocks.clk_io_div4_infra), |
| 2086 | .rst_main_ni (rstmgr_aon_resets.rst_sys_n[rstmgr_pkg::Domain0Sel]), |
| 2087 | .rst_fixed_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2088 | |
| 2089 | // port: tl_corei |
| 2090 | .tl_corei_i(main_tl_corei_req), |
| 2091 | .tl_corei_o(main_tl_corei_rsp), |
| 2092 | |
| 2093 | // port: tl_cored |
| 2094 | .tl_cored_i(main_tl_cored_req), |
| 2095 | .tl_cored_o(main_tl_cored_rsp), |
| 2096 | |
| 2097 | // port: tl_dm_sba |
| 2098 | .tl_dm_sba_i(main_tl_dm_sba_req), |
| 2099 | .tl_dm_sba_o(main_tl_dm_sba_rsp), |
| 2100 | |
| 2101 | // port: tl_rom |
| 2102 | .tl_rom_o(rom_tl_req), |
| 2103 | .tl_rom_i(rom_tl_rsp), |
| 2104 | |
| 2105 | // port: tl_debug_mem |
| 2106 | .tl_debug_mem_o(main_tl_debug_mem_req), |
| 2107 | .tl_debug_mem_i(main_tl_debug_mem_rsp), |
| 2108 | |
| 2109 | // port: tl_ram_main |
| 2110 | .tl_ram_main_o(ram_main_tl_req), |
| 2111 | .tl_ram_main_i(ram_main_tl_rsp), |
| 2112 | |
| 2113 | // port: tl_eflash |
| 2114 | .tl_eflash_o(eflash_tl_req), |
| 2115 | .tl_eflash_i(eflash_tl_rsp), |
| 2116 | |
| 2117 | // port: tl_peri |
| 2118 | .tl_peri_o(main_tl_peri_req), |
| 2119 | .tl_peri_i(main_tl_peri_rsp), |
| 2120 | |
| 2121 | // port: tl_flash_ctrl |
| 2122 | .tl_flash_ctrl_o(flash_ctrl_tl_req), |
| 2123 | .tl_flash_ctrl_i(flash_ctrl_tl_rsp), |
| 2124 | |
| 2125 | // port: tl_hmac |
| 2126 | .tl_hmac_o(hmac_tl_req), |
| 2127 | .tl_hmac_i(hmac_tl_rsp), |
| 2128 | |
Eunchan Kim | e5d33b7 | 2020-11-03 14:34:16 -0800 | [diff] [blame] | 2129 | // port: tl_kmac |
| 2130 | .tl_kmac_o(kmac_tl_req), |
| 2131 | .tl_kmac_i(kmac_tl_rsp), |
| 2132 | |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2133 | // port: tl_aes |
| 2134 | .tl_aes_o(aes_tl_req), |
| 2135 | .tl_aes_i(aes_tl_rsp), |
| 2136 | |
Mark Branstad | ff80736 | 2020-11-16 07:56:15 -0800 | [diff] [blame] | 2137 | // port: tl_entropy_src |
| 2138 | .tl_entropy_src_o(entropy_src_tl_req), |
| 2139 | .tl_entropy_src_i(entropy_src_tl_rsp), |
| 2140 | |
| 2141 | // port: tl_csrng |
| 2142 | .tl_csrng_o(csrng_tl_req), |
| 2143 | .tl_csrng_i(csrng_tl_rsp), |
| 2144 | |
| 2145 | // port: tl_edn0 |
| 2146 | .tl_edn0_o(edn0_tl_req), |
| 2147 | .tl_edn0_i(edn0_tl_rsp), |
| 2148 | |
| 2149 | // port: tl_edn1 |
| 2150 | .tl_edn1_o(edn1_tl_req), |
| 2151 | .tl_edn1_i(edn1_tl_rsp), |
| 2152 | |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2153 | // port: tl_rv_plic |
| 2154 | .tl_rv_plic_o(rv_plic_tl_req), |
| 2155 | .tl_rv_plic_i(rv_plic_tl_rsp), |
| 2156 | |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2157 | // port: tl_otbn |
| 2158 | .tl_otbn_o(otbn_tl_req), |
| 2159 | .tl_otbn_i(otbn_tl_rsp), |
| 2160 | |
Timothy Chen | 9495372 | 2020-09-18 16:15:12 -0700 | [diff] [blame] | 2161 | // port: tl_keymgr |
| 2162 | .tl_keymgr_o(keymgr_tl_req), |
| 2163 | .tl_keymgr_i(keymgr_tl_rsp), |
| 2164 | |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 2165 | // port: tl_sram_ctrl_main |
| 2166 | .tl_sram_ctrl_main_o(sram_ctrl_main_tl_req), |
| 2167 | .tl_sram_ctrl_main_i(sram_ctrl_main_tl_rsp), |
| 2168 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2169 | |
| 2170 | .scanmode_i |
| 2171 | ); |
Eunchan Kim | 55d7ae8 | 2019-12-19 17:08:35 -0800 | [diff] [blame] | 2172 | xbar_peri u_xbar_peri ( |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2173 | .clk_peri_i (clkmgr_aon_clocks.clk_io_div4_infra), |
| 2174 | .rst_peri_ni (rstmgr_aon_resets.rst_sys_io_div4_n[rstmgr_pkg::Domain0Sel]), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2175 | |
| 2176 | // port: tl_main |
| 2177 | .tl_main_i(main_tl_peri_req), |
| 2178 | .tl_main_o(main_tl_peri_rsp), |
| 2179 | |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2180 | // port: tl_uart0 |
| 2181 | .tl_uart0_o(uart0_tl_req), |
| 2182 | .tl_uart0_i(uart0_tl_rsp), |
| 2183 | |
| 2184 | // port: tl_uart1 |
| 2185 | .tl_uart1_o(uart1_tl_req), |
| 2186 | .tl_uart1_i(uart1_tl_rsp), |
| 2187 | |
| 2188 | // port: tl_uart2 |
| 2189 | .tl_uart2_o(uart2_tl_req), |
| 2190 | .tl_uart2_i(uart2_tl_rsp), |
| 2191 | |
| 2192 | // port: tl_uart3 |
| 2193 | .tl_uart3_o(uart3_tl_req), |
| 2194 | .tl_uart3_i(uart3_tl_rsp), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2195 | |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 2196 | // port: tl_i2c0 |
| 2197 | .tl_i2c0_o(i2c0_tl_req), |
| 2198 | .tl_i2c0_i(i2c0_tl_rsp), |
| 2199 | |
| 2200 | // port: tl_i2c1 |
| 2201 | .tl_i2c1_o(i2c1_tl_req), |
| 2202 | .tl_i2c1_i(i2c1_tl_rsp), |
| 2203 | |
| 2204 | // port: tl_i2c2 |
| 2205 | .tl_i2c2_o(i2c2_tl_req), |
| 2206 | .tl_i2c2_i(i2c2_tl_rsp), |
| 2207 | |
| 2208 | // port: tl_pattgen |
| 2209 | .tl_pattgen_o(pattgen_tl_req), |
| 2210 | .tl_pattgen_i(pattgen_tl_rsp), |
| 2211 | |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2212 | // port: tl_gpio |
| 2213 | .tl_gpio_o(gpio_tl_req), |
| 2214 | .tl_gpio_i(gpio_tl_rsp), |
| 2215 | |
| 2216 | // port: tl_spi_device |
| 2217 | .tl_spi_device_o(spi_device_tl_req), |
| 2218 | .tl_spi_device_i(spi_device_tl_rsp), |
| 2219 | |
| 2220 | // port: tl_rv_timer |
| 2221 | .tl_rv_timer_o(rv_timer_tl_req), |
| 2222 | .tl_rv_timer_i(rv_timer_tl_rsp), |
| 2223 | |
| 2224 | // port: tl_usbdev |
| 2225 | .tl_usbdev_o(usbdev_tl_req), |
| 2226 | .tl_usbdev_i(usbdev_tl_rsp), |
| 2227 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2228 | // port: tl_pwrmgr_aon |
| 2229 | .tl_pwrmgr_aon_o(pwrmgr_aon_tl_req), |
| 2230 | .tl_pwrmgr_aon_i(pwrmgr_aon_tl_rsp), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2231 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2232 | // port: tl_rstmgr_aon |
| 2233 | .tl_rstmgr_aon_o(rstmgr_aon_tl_req), |
| 2234 | .tl_rstmgr_aon_i(rstmgr_aon_tl_rsp), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2235 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2236 | // port: tl_clkmgr_aon |
| 2237 | .tl_clkmgr_aon_o(clkmgr_aon_tl_req), |
| 2238 | .tl_clkmgr_aon_i(clkmgr_aon_tl_rsp), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2239 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2240 | // port: tl_pinmux_aon |
| 2241 | .tl_pinmux_aon_o(pinmux_aon_tl_req), |
| 2242 | .tl_pinmux_aon_i(pinmux_aon_tl_rsp), |
| 2243 | |
| 2244 | // port: tl_padctrl_aon |
| 2245 | .tl_padctrl_aon_o(padctrl_aon_tl_req), |
| 2246 | .tl_padctrl_aon_i(padctrl_aon_tl_rsp), |
| 2247 | |
| 2248 | // port: tl_ram_ret_aon |
| 2249 | .tl_ram_ret_aon_o(ram_ret_aon_tl_req), |
| 2250 | .tl_ram_ret_aon_i(ram_ret_aon_tl_rsp), |
Eunchan Kim | 0f54954 | 2020-08-04 10:40:11 -0700 | [diff] [blame] | 2251 | |
Michael Schaffner | a304560 | 2020-10-06 19:19:46 -0700 | [diff] [blame] | 2252 | // port: tl_otp_ctrl |
| 2253 | .tl_otp_ctrl_o(otp_ctrl_tl_req), |
| 2254 | .tl_otp_ctrl_i(otp_ctrl_tl_rsp), |
| 2255 | |
Michael Schaffner | 6d3d6a0 | 2020-12-11 13:52:51 -0800 | [diff] [blame] | 2256 | // port: tl_lc_ctrl |
| 2257 | .tl_lc_ctrl_o(lc_ctrl_tl_req), |
| 2258 | .tl_lc_ctrl_i(lc_ctrl_tl_rsp), |
| 2259 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2260 | // port: tl_sensor_ctrl_aon |
| 2261 | .tl_sensor_ctrl_aon_o(sensor_ctrl_aon_tl_req), |
| 2262 | .tl_sensor_ctrl_aon_i(sensor_ctrl_aon_tl_rsp), |
Timothy Chen | 1555dce | 2020-08-11 11:26:50 -0700 | [diff] [blame] | 2263 | |
Michael Schaffner | d1fc7d1 | 2020-12-21 12:52:23 -0800 | [diff] [blame] | 2264 | // port: tl_alert_handler |
| 2265 | .tl_alert_handler_o(alert_handler_tl_req), |
| 2266 | .tl_alert_handler_i(alert_handler_tl_rsp), |
| 2267 | |
Timothy Chen | 8aeeb49 | 2021-02-01 21:25:17 -0800 | [diff] [blame] | 2268 | // port: tl_sram_ctrl_ret_aon |
| 2269 | .tl_sram_ctrl_ret_aon_o(sram_ctrl_ret_aon_tl_req), |
| 2270 | .tl_sram_ctrl_ret_aon_i(sram_ctrl_ret_aon_tl_rsp), |
Michael Schaffner | 9da4db8 | 2020-12-21 15:35:24 -0800 | [diff] [blame] | 2271 | |
Michael Schaffner | d1fc7d1 | 2020-12-21 12:52:23 -0800 | [diff] [blame] | 2272 | // port: tl_nmi_gen |
| 2273 | .tl_nmi_gen_o(nmi_gen_tl_req), |
| 2274 | .tl_nmi_gen_i(nmi_gen_tl_rsp), |
| 2275 | |
Timothy Chen | fb34fe3 | 2020-08-26 17:13:19 -0700 | [diff] [blame] | 2276 | // port: tl_ast_wrapper |
| 2277 | .tl_ast_wrapper_o(ast_tl_req_o), |
| 2278 | .tl_ast_wrapper_i(ast_tl_rsp_i), |
| 2279 | |
Eunchan Kim | 55d7ae8 | 2019-12-19 17:08:35 -0800 | [diff] [blame] | 2280 | |
| 2281 | .scanmode_i |
| 2282 | ); |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2283 | |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 2284 | // Pinmux connections |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2285 | assign mio_d2p = { |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 2286 | cio_pattgen_pcl1_tx_d2p, |
| 2287 | cio_pattgen_pda1_tx_d2p, |
| 2288 | cio_pattgen_pcl0_tx_d2p, |
| 2289 | cio_pattgen_pda0_tx_d2p, |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2290 | cio_uart3_tx_d2p, |
| 2291 | cio_uart2_tx_d2p, |
| 2292 | cio_uart1_tx_d2p, |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 2293 | cio_i2c2_scl_d2p, |
| 2294 | cio_i2c2_sda_d2p, |
| 2295 | cio_i2c1_scl_d2p, |
| 2296 | cio_i2c1_sda_d2p, |
| 2297 | cio_i2c0_scl_d2p, |
| 2298 | cio_i2c0_sda_d2p, |
Philipp Wagner | 9ac69c6 | 2020-12-14 19:22:38 +0000 | [diff] [blame] | 2299 | cio_gpio_gpio_d2p |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 2300 | }; |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2301 | assign mio_d2p_en = { |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 2302 | cio_pattgen_pcl1_tx_en_d2p, |
| 2303 | cio_pattgen_pda1_tx_en_d2p, |
| 2304 | cio_pattgen_pcl0_tx_en_d2p, |
| 2305 | cio_pattgen_pda0_tx_en_d2p, |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2306 | cio_uart3_tx_en_d2p, |
| 2307 | cio_uart2_tx_en_d2p, |
| 2308 | cio_uart1_tx_en_d2p, |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 2309 | cio_i2c2_scl_en_d2p, |
| 2310 | cio_i2c2_sda_en_d2p, |
| 2311 | cio_i2c1_scl_en_d2p, |
| 2312 | cio_i2c1_sda_en_d2p, |
| 2313 | cio_i2c0_scl_en_d2p, |
| 2314 | cio_i2c0_sda_en_d2p, |
Philipp Wagner | 9ac69c6 | 2020-12-14 19:22:38 +0000 | [diff] [blame] | 2315 | cio_gpio_gpio_en_d2p |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 2316 | }; |
| 2317 | assign { |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2318 | cio_uart3_rx_p2d, |
| 2319 | cio_uart2_rx_p2d, |
| 2320 | cio_uart1_rx_p2d, |
Timothy Chen | 469a303 | 2021-02-01 15:44:09 -0800 | [diff] [blame] | 2321 | cio_i2c2_scl_p2d, |
| 2322 | cio_i2c2_sda_p2d, |
| 2323 | cio_i2c1_scl_p2d, |
| 2324 | cio_i2c1_sda_p2d, |
| 2325 | cio_i2c0_scl_p2d, |
| 2326 | cio_i2c0_sda_p2d, |
Philipp Wagner | 360addb | 2020-12-14 19:22:25 +0000 | [diff] [blame] | 2327 | cio_gpio_gpio_p2d |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2328 | } = mio_p2d; |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 2329 | |
Michael Schaffner | 920e4cc | 2020-04-28 22:58:12 -0700 | [diff] [blame] | 2330 | // Dedicated IO connections |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2331 | // Input-only DIOs have no d2p signals |
| 2332 | assign dio_d2p = { |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 2333 | 1'b0, // DIO14: cio_spi_device_sck |
| 2334 | 1'b0, // DIO13: cio_spi_device_csb |
Scott Johnson | fe79c4b | 2020-07-08 10:31:08 -0700 | [diff] [blame] | 2335 | 1'b0, // DIO12: cio_spi_device_sdi |
| 2336 | cio_spi_device_sdo_d2p, // DIO11 |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2337 | 1'b0, // DIO10: cio_uart0_rx |
| 2338 | cio_uart0_tx_d2p, // DIO9 |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 2339 | 1'b0, // DIO8: cio_usbdev_sense |
| 2340 | cio_usbdev_se0_d2p, // DIO7 |
| 2341 | cio_usbdev_dp_pullup_d2p, // DIO6 |
| 2342 | cio_usbdev_dn_pullup_d2p, // DIO5 |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2343 | cio_usbdev_tx_mode_se_d2p, // DIO4 |
| 2344 | cio_usbdev_suspend_d2p, // DIO3 |
| 2345 | cio_usbdev_d_d2p, // DIO2 |
| 2346 | cio_usbdev_dp_d2p, // DIO1 |
| 2347 | cio_usbdev_dn_d2p // DIO0 |
Michael Schaffner | 920e4cc | 2020-04-28 22:58:12 -0700 | [diff] [blame] | 2348 | }; |
| 2349 | |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2350 | assign dio_d2p_en = { |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 2351 | 1'b0, // DIO14: cio_spi_device_sck |
| 2352 | 1'b0, // DIO13: cio_spi_device_csb |
Scott Johnson | fe79c4b | 2020-07-08 10:31:08 -0700 | [diff] [blame] | 2353 | 1'b0, // DIO12: cio_spi_device_sdi |
| 2354 | cio_spi_device_sdo_en_d2p, // DIO11 |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2355 | 1'b0, // DIO10: cio_uart0_rx |
| 2356 | cio_uart0_tx_en_d2p, // DIO9 |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 2357 | 1'b0, // DIO8: cio_usbdev_sense |
| 2358 | cio_usbdev_se0_en_d2p, // DIO7 |
| 2359 | cio_usbdev_dp_pullup_en_d2p, // DIO6 |
| 2360 | cio_usbdev_dn_pullup_en_d2p, // DIO5 |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2361 | cio_usbdev_tx_mode_se_en_d2p, // DIO4 |
| 2362 | cio_usbdev_suspend_en_d2p, // DIO3 |
| 2363 | cio_usbdev_d_en_d2p, // DIO2 |
| 2364 | cio_usbdev_dp_en_d2p, // DIO1 |
| 2365 | cio_usbdev_dn_en_d2p // DIO0 |
Michael Schaffner | 920e4cc | 2020-04-28 22:58:12 -0700 | [diff] [blame] | 2366 | }; |
| 2367 | |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2368 | // Output-only DIOs have no p2d signal |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 2369 | assign cio_spi_device_sck_p2d = dio_p2d[14]; // DIO14 |
| 2370 | assign cio_spi_device_csb_p2d = dio_p2d[13]; // DIO13 |
Scott Johnson | fe79c4b | 2020-07-08 10:31:08 -0700 | [diff] [blame] | 2371 | assign cio_spi_device_sdi_p2d = dio_p2d[12]; // DIO12 |
| 2372 | // DIO11: cio_spi_device_sdo |
Timothy Chen | 2971a1e | 2021-01-21 16:00:01 -0800 | [diff] [blame] | 2373 | assign cio_uart0_rx_p2d = dio_p2d[10]; // DIO10 |
| 2374 | // DIO9: cio_uart0_tx |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 2375 | assign cio_usbdev_sense_p2d = dio_p2d[8]; // DIO8 |
| 2376 | // DIO7: cio_usbdev_se0 |
| 2377 | // DIO6: cio_usbdev_dp_pullup |
| 2378 | // DIO5: cio_usbdev_dn_pullup |
Michael Schaffner | 79eb65f | 2020-05-01 19:12:47 -0700 | [diff] [blame] | 2379 | // DIO4: cio_usbdev_tx_mode_se |
| 2380 | // DIO3: cio_usbdev_suspend |
| 2381 | assign cio_usbdev_d_p2d = dio_p2d[2]; // DIO2 |
| 2382 | assign cio_usbdev_dp_p2d = dio_p2d[1]; // DIO1 |
| 2383 | assign cio_usbdev_dn_p2d = dio_p2d[0]; // DIO0 |
Eunchan Kim | 769065e | 2019-10-29 17:29:26 -0700 | [diff] [blame] | 2384 | |
Nils Graf | 78607aa | 2019-09-16 15:47:23 -0700 | [diff] [blame] | 2385 | // make sure scanmode_i is never X (including during reset) |
Eunchan Kim | 5511bbe | 2020-08-07 14:04:20 -0700 | [diff] [blame] | 2386 | `ASSERT_KNOWN(scanmodeKnown, scanmode_i, clk_main_i, 0) |
Nils Graf | 78607aa | 2019-09-16 15:47:23 -0700 | [diff] [blame] | 2387 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 2388 | endmodule |