Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 1 | /*--------------------------------------------------------------*/ |
| 2 | /* caravel, a project harness for the Google/SkyWater sky130 */ |
| 3 | /* fabrication process and open source PDK */ |
| 4 | /* */ |
| 5 | /* Copyright 2020 efabless, Inc. */ |
| 6 | /* Written by Tim Edwards, December 2019 */ |
| 7 | /* and Mohamed Shalan, August 2020 */ |
| 8 | /* This file is open source hardware released under the */ |
| 9 | /* Apache 2.0 license. See file LICENSE. */ |
| 10 | /* */ |
| 11 | /*--------------------------------------------------------------*/ |
| 12 | |
| 13 | `timescale 1 ns / 1 ps |
| 14 | |
Tim Edwards | e2ef673 | 2020-10-12 17:25:12 -0400 | [diff] [blame] | 15 | `define USE_POWER_PINS |
Tim Edwards | c5265b8 | 2020-09-25 17:08:59 -0400 | [diff] [blame] | 16 | `define UNIT_DELAY #1 |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 17 | |
Ahmed Ghazy | 22d29d6 | 2020-10-28 03:42:02 +0200 | [diff] [blame^] | 18 | `include "defines.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 19 | `include "pads.v" |
| 20 | |
Tim Edwards | 4286ae1 | 2020-10-11 14:52:01 -0400 | [diff] [blame] | 21 | /* NOTE: Need to pass the PDK root directory to iverilog with option -I */ |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 22 | |
Tim Edwards | 4286ae1 | 2020-10-11 14:52:01 -0400 | [diff] [blame] | 23 | `include "libs.ref/sky130_fd_io/verilog/sky130_fd_io.v" |
Tim Edwards | 4c73335 | 2020-10-12 16:32:36 -0400 | [diff] [blame] | 24 | `include "libs.ref/sky130_fd_io/verilog/sky130_ef_io.v" |
Tim Edwards | 4286ae1 | 2020-10-11 14:52:01 -0400 | [diff] [blame] | 25 | |
| 26 | `include "libs.ref/sky130_fd_sc_hd/verilog/primitives.v" |
| 27 | `include "libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v" |
| 28 | `include "libs.ref/sky130_fd_sc_hvl/verilog/primitives.v" |
| 29 | `include "libs.ref/sky130_fd_sc_hvl/verilog/sky130_fd_sc_hvl.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 30 | |
| 31 | `include "mgmt_soc.v" |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 32 | `include "housekeeping_spi.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 33 | `include "digital_pll.v" |
Tim Edwards | 3245e2f | 2020-10-10 14:02:11 -0400 | [diff] [blame] | 34 | `include "caravel_clocking.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 35 | `include "mgmt_core.v" |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 36 | `include "mgmt_protect.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 37 | `include "mprj_io.v" |
| 38 | `include "chip_io.v" |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 39 | `include "user_id_programming.v" |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 40 | `include "user_project_wrapper.v" |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 41 | `include "gpio_control_block.v" |
Tim Edwards | 3245e2f | 2020-10-10 14:02:11 -0400 | [diff] [blame] | 42 | `include "clock_div.v" |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 43 | `include "simple_por.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 44 | |
Tim Edwards | 0553751 | 2020-10-06 14:59:26 -0400 | [diff] [blame] | 45 | /*------------------------------*/ |
| 46 | /* Include user project here */ |
| 47 | /*------------------------------*/ |
| 48 | `include "user_proj_example.v" |
| 49 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 50 | `ifdef USE_OPENRAM |
Manar | 14d35ac | 2020-10-21 22:47:15 +0200 | [diff] [blame] | 51 | `include "sram_1rw1r_32_256_8_sky130.v" |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 52 | `endif |
| 53 | |
| 54 | module caravel ( |
Tim Edwards | 9eda80d | 2020-10-08 21:36:44 -0400 | [diff] [blame] | 55 | inout vddio, // Common 3.3V padframe/ESD power |
| 56 | inout vssio, // Common padframe/ESD ground |
| 57 | inout vdda, // Management 3.3V power |
| 58 | inout vssa, // Common analog ground |
| 59 | inout vccd, // Management/Common 1.8V power |
| 60 | inout vssd, // Common digital ground |
| 61 | inout vdda1, // User area 1 3.3V power |
| 62 | inout vdda2, // User area 2 3.3V power |
| 63 | inout vssa1, // User area 1 analog ground |
| 64 | inout vssa2, // User area 2 analog ground |
| 65 | inout vccd1, // User area 1 1.8V power |
| 66 | inout vccd2, // User area 2 1.8V power |
| 67 | inout vssd1, // User area 1 digital ground |
| 68 | inout vssd2, // User area 2 digital ground |
| 69 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 70 | inout gpio, // Used for external LDO control |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 71 | inout [`MPRJ_IO_PADS-1:0] mprj_io, |
Tim Edwards | ba32890 | 2020-10-27 15:03:22 -0400 | [diff] [blame] | 72 | output [`MPRJ_PWR_PADS-1:0] pwr_ctrl_out, |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 73 | input clock, // CMOS core clock input, not a crystal |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 74 | input resetb, |
| 75 | |
| 76 | // Note that only two pins are available on the flash so dual and |
| 77 | // quad flash modes are not available. |
| 78 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 79 | output flash_csb, |
| 80 | output flash_clk, |
| 81 | output flash_io0, |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 82 | output flash_io1 |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 83 | ); |
| 84 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 85 | //------------------------------------------------------------ |
| 86 | // This value is uniquely defined for each user project. |
| 87 | //------------------------------------------------------------ |
| 88 | parameter USER_PROJECT_ID = 32'h0; |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 89 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 90 | // These pins are overlaid on mprj_io space. They have the function |
| 91 | // below when the management processor is in reset, or in the default |
| 92 | // configuration. They are assigned to uses in the user space by the |
| 93 | // configuration program running off of the SPI flash. Note that even |
| 94 | // when the user has taken control of these pins, they can be restored |
| 95 | // to the original use by setting the resetb pin low. The SPI pins and |
| 96 | // UART pins can be connected directly to an FTDI chip as long as the |
| 97 | // FTDI chip sets these lines to high impedence (input function) at |
| 98 | // all times except when holding the chip in reset. |
| 99 | |
| 100 | // JTAG = mprj_io[0] (inout) |
| 101 | // SDO = mprj_io[1] (output) |
| 102 | // SDI = mprj_io[2] (input) |
| 103 | // CSB = mprj_io[3] (input) |
| 104 | // SCK = mprj_io[4] (input) |
| 105 | // ser_rx = mprj_io[5] (input) |
| 106 | // ser_tx = mprj_io[6] (output) |
| 107 | // irq = mprj_io[7] (input) |
| 108 | |
| 109 | // These pins are reserved for any project that wants to incorporate |
| 110 | // its own processor and flash controller. While a user project can |
| 111 | // technically use any available I/O pins for the purpose, these |
| 112 | // four pins connect to a pass-through mode from the SPI slave (pins |
| 113 | // 1-4 above) so that any SPI flash connected to these specific pins |
| 114 | // can be accessed through the SPI slave even when the processor is in |
| 115 | // reset. |
| 116 | |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 117 | // user_flash_csb = mprj_io[8] |
| 118 | // user_flash_sck = mprj_io[9] |
| 119 | // user_flash_io0 = mprj_io[10] |
| 120 | // user_flash_io1 = mprj_io[11] |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 121 | |
| 122 | // One-bit GPIO dedicated to management SoC (outside of user control) |
| 123 | wire gpio_out_core; |
| 124 | wire gpio_in_core; |
| 125 | wire gpio_mode0_core; |
| 126 | wire gpio_mode1_core; |
| 127 | wire gpio_outenb_core; |
| 128 | wire gpio_inenb_core; |
| 129 | |
Tim Edwards | 6d9739d | 2020-10-19 11:00:49 -0400 | [diff] [blame] | 130 | // User Project Control (pad-facing) |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 131 | wire mprj_io_loader_resetn; |
| 132 | wire mprj_io_loader_clock; |
| 133 | wire mprj_io_loader_data; |
| 134 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 135 | wire [`MPRJ_IO_PADS-1:0] mprj_io_hldh_n; |
| 136 | wire [`MPRJ_IO_PADS-1:0] mprj_io_enh; |
| 137 | wire [`MPRJ_IO_PADS-1:0] mprj_io_inp_dis; |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 138 | wire [`MPRJ_IO_PADS-1:0] mprj_io_oeb; |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 139 | wire [`MPRJ_IO_PADS-1:0] mprj_io_ib_mode_sel; |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 140 | wire [`MPRJ_IO_PADS-1:0] mprj_io_vtrip_sel; |
| 141 | wire [`MPRJ_IO_PADS-1:0] mprj_io_slow_sel; |
| 142 | wire [`MPRJ_IO_PADS-1:0] mprj_io_holdover; |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 143 | wire [`MPRJ_IO_PADS-1:0] mprj_io_analog_en; |
| 144 | wire [`MPRJ_IO_PADS-1:0] mprj_io_analog_sel; |
| 145 | wire [`MPRJ_IO_PADS-1:0] mprj_io_analog_pol; |
| 146 | wire [`MPRJ_IO_PADS*3-1:0] mprj_io_dm; |
| 147 | wire [`MPRJ_IO_PADS-1:0] mprj_io_in; |
| 148 | wire [`MPRJ_IO_PADS-1:0] mprj_io_out; |
| 149 | |
Tim Edwards | 6d9739d | 2020-10-19 11:00:49 -0400 | [diff] [blame] | 150 | // User Project Control (user-facing) |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 151 | wire [`MPRJ_IO_PADS-1:0] user_io_oeb; |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 152 | wire [`MPRJ_IO_PADS-1:0] user_io_in; |
| 153 | wire [`MPRJ_IO_PADS-1:0] user_io_out; |
| 154 | |
| 155 | /* Padframe control signals */ |
| 156 | wire [`MPRJ_IO_PADS-1:0] gpio_serial_link; |
| 157 | wire mgmt_serial_clock; |
| 158 | wire mgmt_serial_resetn; |
| 159 | |
Tim Edwards | 6d9739d | 2020-10-19 11:00:49 -0400 | [diff] [blame] | 160 | // User Project Control management I/O |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 161 | // There are two types of GPIO connections: |
| 162 | // (1) Full Bidirectional: Management connects to in, out, and oeb |
| 163 | // Uses: JTAG and SDO |
| 164 | // (2) Selectable bidirectional: Management connects to in and out, |
| 165 | // which are tied together. oeb is grounded (oeb from the |
| 166 | // configuration is used) |
| 167 | |
| 168 | // SDI = mprj_io[2] (input) |
| 169 | // CSB = mprj_io[3] (input) |
| 170 | // SCK = mprj_io[4] (input) |
| 171 | // ser_rx = mprj_io[5] (input) |
| 172 | // ser_tx = mprj_io[6] (output) |
| 173 | // irq = mprj_io[7] (input) |
| 174 | |
| 175 | wire [`MPRJ_IO_PADS-1:0] mgmt_io_in; |
| 176 | wire jtag_out, sdo_out; |
| 177 | wire jtag_outenb, sdo_outenb; |
| 178 | |
| 179 | wire [`MPRJ_IO_PADS-3:0] mgmt_io_nc1; /* no-connects */ |
| 180 | wire [`MPRJ_IO_PADS-3:0] mgmt_io_nc3; /* no-connects */ |
| 181 | wire [1:0] mgmt_io_nc2; /* no-connects */ |
| 182 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 183 | // Power-on-reset signal. The reset pad generates the sense-inverted |
| 184 | // reset at 3.3V. The 1.8V signal and the inverted 1.8V signal are |
| 185 | // derived. |
| 186 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 187 | wire porb_h; |
| 188 | wire porb_l; |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 189 | |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 190 | wire rstb_h; |
| 191 | wire rstb_l; |
| 192 | |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 193 | // To be considered: Master hold signal on all user pads (?) |
| 194 | // For now, set holdh_n to 1 (NOTE: This is in the 3.3V domain) |
| 195 | // and setting enh to porb_h. |
Tim Edwards | 9eda80d | 2020-10-08 21:36:44 -0400 | [diff] [blame] | 196 | assign mprj_io_hldh_n = {`MPRJ_IO_PADS{vddio}}; |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 197 | assign mprj_io_enh = {`MPRJ_IO_PADS{porb_h}}; |
| 198 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 199 | chip_io padframe( |
| 200 | // Package Pins |
Tim Edwards | 9eda80d | 2020-10-08 21:36:44 -0400 | [diff] [blame] | 201 | .vddio(vddio), |
| 202 | .vssio(vssio), |
| 203 | .vdda(vdda), |
| 204 | .vssa(vssa), |
| 205 | .vccd(vccd), |
| 206 | .vssd(vssd), |
| 207 | .vdda1(vdda1), |
| 208 | .vdda2(vdda2), |
| 209 | .vssa1(vssa1), |
| 210 | .vssa2(vssa2), |
| 211 | .vccd1(vccd1), |
| 212 | .vccd2(vccd2), |
| 213 | .vssd1(vssd1), |
| 214 | .vssd2(vssd2), |
| 215 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 216 | .gpio(gpio), |
| 217 | .mprj_io(mprj_io), |
| 218 | .clock(clock), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 219 | .resetb(resetb), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 220 | .flash_csb(flash_csb), |
| 221 | .flash_clk(flash_clk), |
| 222 | .flash_io0(flash_io0), |
| 223 | .flash_io1(flash_io1), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 224 | // SoC Core Interface |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 225 | .porb_h(porb_h), |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 226 | .resetb_core_h(rstb_h), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 227 | .clock_core(clock_core), |
| 228 | .gpio_out_core(gpio_out_core), |
| 229 | .gpio_in_core(gpio_in_core), |
| 230 | .gpio_mode0_core(gpio_mode0_core), |
| 231 | .gpio_mode1_core(gpio_mode1_core), |
| 232 | .gpio_outenb_core(gpio_outenb_core), |
| 233 | .gpio_inenb_core(gpio_inenb_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 234 | .flash_csb_core(flash_csb_core), |
| 235 | .flash_clk_core(flash_clk_core), |
| 236 | .flash_csb_oeb_core(flash_csb_oeb_core), |
| 237 | .flash_clk_oeb_core(flash_clk_oeb_core), |
| 238 | .flash_io0_oeb_core(flash_io0_oeb_core), |
| 239 | .flash_io1_oeb_core(flash_io1_oeb_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 240 | .flash_csb_ieb_core(flash_csb_ieb_core), |
| 241 | .flash_clk_ieb_core(flash_clk_ieb_core), |
| 242 | .flash_io0_ieb_core(flash_io0_ieb_core), |
| 243 | .flash_io1_ieb_core(flash_io1_ieb_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 244 | .flash_io0_do_core(flash_io0_do_core), |
| 245 | .flash_io1_do_core(flash_io1_do_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 246 | .flash_io0_di_core(flash_io0_di_core), |
| 247 | .flash_io1_di_core(flash_io1_di_core), |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 248 | .por(~porb_l), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 249 | .mprj_io_in(mprj_io_in), |
| 250 | .mprj_io_out(mprj_io_out), |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 251 | .mprj_io_oeb(mprj_io_oeb), |
Manar | 14d35ac | 2020-10-21 22:47:15 +0200 | [diff] [blame] | 252 | .mprj_io_hldh_n(mprj_io_hldh_n), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 253 | .mprj_io_enh(mprj_io_enh), |
Manar | 14d35ac | 2020-10-21 22:47:15 +0200 | [diff] [blame] | 254 | .mprj_io_inp_dis(mprj_io_inp_dis), |
| 255 | .mprj_io_ib_mode_sel(mprj_io_ib_mode_sel), |
| 256 | .mprj_io_vtrip_sel(mprj_io_vtrip_sel), |
| 257 | .mprj_io_slow_sel(mprj_io_slow_sel), |
| 258 | .mprj_io_holdover(mprj_io_holdover), |
| 259 | .mprj_io_analog_en(mprj_io_analog_en), |
| 260 | .mprj_io_analog_sel(mprj_io_analog_sel), |
| 261 | .mprj_io_analog_pol(mprj_io_analog_pol), |
| 262 | .mprj_io_dm(mprj_io_dm) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 263 | ); |
| 264 | |
| 265 | // SoC core |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 266 | wire caravel_clk; |
Tim Edwards | 7a8cbb1 | 2020-10-12 11:32:11 -0400 | [diff] [blame] | 267 | wire caravel_clk2; |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 268 | wire caravel_rstn; |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 269 | |
| 270 | wire [7:0] spi_ro_config_core; |
| 271 | |
| 272 | // LA signals |
| 273 | wire [127:0] la_output_core; // From CPU to MPRJ |
| 274 | wire [127:0] la_data_in_mprj; // From CPU to MPRJ |
| 275 | wire [127:0] la_data_out_mprj; // From CPU to MPRJ |
| 276 | wire [127:0] la_output_mprj; // From MPRJ to CPU |
| 277 | wire [127:0] la_oen; // LA output enable from CPU perspective (active-low) |
| 278 | |
Tim Edwards | 6d9739d | 2020-10-19 11:00:49 -0400 | [diff] [blame] | 279 | // WB MI A (User Project) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 280 | wire mprj_cyc_o_core; |
| 281 | wire mprj_stb_o_core; |
| 282 | wire mprj_we_o_core; |
| 283 | wire [3:0] mprj_sel_o_core; |
| 284 | wire [31:0] mprj_adr_o_core; |
| 285 | wire [31:0] mprj_dat_o_core; |
| 286 | wire mprj_ack_i_core; |
| 287 | wire [31:0] mprj_dat_i_core; |
| 288 | |
| 289 | // WB MI B (xbar) |
| 290 | wire xbar_cyc_o_core; |
| 291 | wire xbar_stb_o_core; |
| 292 | wire xbar_we_o_core; |
| 293 | wire [3:0] xbar_sel_o_core; |
| 294 | wire [31:0] xbar_adr_o_core; |
| 295 | wire [31:0] xbar_dat_o_core; |
| 296 | wire xbar_ack_i_core; |
| 297 | wire [31:0] xbar_dat_i_core; |
| 298 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 299 | // Mask revision |
| 300 | wire [31:0] mask_rev; |
| 301 | |
Manar | 14d35ac | 2020-10-21 22:47:15 +0200 | [diff] [blame] | 302 | wire mprj_clock; |
| 303 | wire mprj_clock2; |
| 304 | wire mprj_resetn; |
| 305 | wire mprj_cyc_o_user; |
| 306 | wire mprj_stb_o_user; |
| 307 | wire mprj_we_o_user; |
| 308 | wire [3:0] mprj_sel_o_user; |
| 309 | wire [31:0] mprj_adr_o_user; |
| 310 | wire [31:0] mprj_dat_o_user; |
| 311 | wire mprj_vcc_pwrgood; |
| 312 | wire mprj2_vcc_pwrgood; |
| 313 | wire mprj_vdd_pwrgood; |
| 314 | wire mprj2_vdd_pwrgood; |
| 315 | |
Ahmed Ghazy | 22d29d6 | 2020-10-28 03:42:02 +0200 | [diff] [blame^] | 316 | mgmt_core soc ( |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 317 | `ifdef LVS |
Tim Edwards | 9eda80d | 2020-10-08 21:36:44 -0400 | [diff] [blame] | 318 | .vdd(vccd), |
| 319 | .vss(vssa), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 320 | `endif |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 321 | // GPIO (1 pin) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 322 | .gpio_out_pad(gpio_out_core), |
| 323 | .gpio_in_pad(gpio_in_core), |
| 324 | .gpio_mode0_pad(gpio_mode0_core), |
| 325 | .gpio_mode1_pad(gpio_mode1_core), |
| 326 | .gpio_outenb_pad(gpio_outenb_core), |
| 327 | .gpio_inenb_pad(gpio_inenb_core), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 328 | // Primary SPI flash controller |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 329 | .flash_csb(flash_csb_core), |
| 330 | .flash_clk(flash_clk_core), |
| 331 | .flash_csb_oeb(flash_csb_oeb_core), |
| 332 | .flash_clk_oeb(flash_clk_oeb_core), |
| 333 | .flash_io0_oeb(flash_io0_oeb_core), |
| 334 | .flash_io1_oeb(flash_io1_oeb_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 335 | .flash_csb_ieb(flash_csb_ieb_core), |
| 336 | .flash_clk_ieb(flash_clk_ieb_core), |
| 337 | .flash_io0_ieb(flash_io0_ieb_core), |
| 338 | .flash_io1_ieb(flash_io1_ieb_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 339 | .flash_io0_do(flash_io0_do_core), |
| 340 | .flash_io1_do(flash_io1_do_core), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 341 | .flash_io0_di(flash_io0_di_core), |
| 342 | .flash_io1_di(flash_io1_di_core), |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 343 | // Master Reset |
| 344 | .resetb(rstb_l), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 345 | .porb(porb_l), |
| 346 | // Clocks and reset |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 347 | .clock(clock_core), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 348 | .core_clk(caravel_clk), |
Tim Edwards | 7a8cbb1 | 2020-10-12 11:32:11 -0400 | [diff] [blame] | 349 | .user_clk(caravel_clk2), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 350 | .core_rstn(caravel_rstn), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 351 | // Logic Analyzer |
| 352 | .la_input(la_data_out_mprj), |
| 353 | .la_output(la_output_core), |
| 354 | .la_oen(la_oen), |
Tim Edwards | 6d9739d | 2020-10-19 11:00:49 -0400 | [diff] [blame] | 355 | // User Project IO Control |
Tim Edwards | 05ad4fc | 2020-10-19 22:12:33 -0400 | [diff] [blame] | 356 | .mprj_vcc_pwrgood(mprj_vcc_pwrgood), |
| 357 | .mprj2_vcc_pwrgood(mprj2_vcc_pwrgood), |
| 358 | .mprj_vdd_pwrgood(mprj_vdd_pwrgood), |
| 359 | .mprj2_vdd_pwrgood(mprj2_vdd_pwrgood), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 360 | .mprj_io_loader_resetn(mprj_io_loader_resetn), |
| 361 | .mprj_io_loader_clock(mprj_io_loader_clock), |
| 362 | .mprj_io_loader_data(mprj_io_loader_data), |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 363 | .mgmt_in_data(mgmt_io_in), |
Tim Edwards | ca2f318 | 2020-10-06 10:05:11 -0400 | [diff] [blame] | 364 | .mgmt_out_data({mgmt_io_in[(`MPRJ_IO_PADS-1):2], mgmt_io_nc2}), |
Tim Edwards | ba32890 | 2020-10-27 15:03:22 -0400 | [diff] [blame] | 365 | .pwr_ctrl_out(pwr_ctrl_out), |
Tim Edwards | ca2f318 | 2020-10-06 10:05:11 -0400 | [diff] [blame] | 366 | .sdo_out(sdo_out), |
| 367 | .sdo_outenb(sdo_outenb), |
| 368 | .jtag_out(jtag_out), |
| 369 | .jtag_outenb(jtag_outenb), |
Tim Edwards | 6d9739d | 2020-10-19 11:00:49 -0400 | [diff] [blame] | 370 | // User Project Slave ports (WB MI A) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 371 | .mprj_cyc_o(mprj_cyc_o_core), |
| 372 | .mprj_stb_o(mprj_stb_o_core), |
| 373 | .mprj_we_o(mprj_we_o_core), |
| 374 | .mprj_sel_o(mprj_sel_o_core), |
| 375 | .mprj_adr_o(mprj_adr_o_core), |
| 376 | .mprj_dat_o(mprj_dat_o_core), |
| 377 | .mprj_ack_i(mprj_ack_i_core), |
| 378 | .mprj_dat_i(mprj_dat_i_core), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 379 | // mask data |
| 380 | .mask_rev(mask_rev) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 381 | ); |
| 382 | |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 383 | /* Clock and reset to user space are passed through a tristate */ |
| 384 | /* buffer like the above, but since they are intended to be */ |
| 385 | /* always active, connect the enable to the logic-1 output from */ |
| 386 | /* the vccd1 domain. */ |
| 387 | |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 388 | mgmt_protect mgmt_buffers ( |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 389 | .vccd(vccd), |
| 390 | .vssd(vssd), |
| 391 | .vccd1(vccd1), |
| 392 | .vssd1(vssd1), |
Tim Edwards | 05ad4fc | 2020-10-19 22:12:33 -0400 | [diff] [blame] | 393 | .vdda1(vdda1), |
| 394 | .vssa1(vssa1), |
| 395 | .vdda2(vdda2), |
| 396 | .vssa2(vssa2), |
Tim Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 397 | |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 398 | .caravel_clk(caravel_clk), |
Tim Edwards | 7a8cbb1 | 2020-10-12 11:32:11 -0400 | [diff] [blame] | 399 | .caravel_clk2(caravel_clk2), |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 400 | .caravel_rstn(caravel_rstn), |
| 401 | .mprj_cyc_o_core(mprj_cyc_o_core), |
| 402 | .mprj_stb_o_core(mprj_stb_o_core), |
| 403 | .mprj_we_o_core(mprj_we_o_core), |
| 404 | .mprj_sel_o_core(mprj_sel_o_core), |
| 405 | .mprj_adr_o_core(mprj_adr_o_core), |
| 406 | .mprj_dat_o_core(mprj_dat_o_core), |
| 407 | .la_output_core(la_output_core), |
| 408 | .la_oen(la_oen), |
| 409 | |
| 410 | .user_clock(mprj_clock), |
Tim Edwards | 7a8cbb1 | 2020-10-12 11:32:11 -0400 | [diff] [blame] | 411 | .user_clock2(mprj_clock2), |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 412 | .user_resetn(mprj_resetn), |
| 413 | .mprj_cyc_o_user(mprj_cyc_o_user), |
| 414 | .mprj_stb_o_user(mprj_stb_o_user), |
| 415 | .mprj_we_o_user(mprj_we_o_user), |
| 416 | .mprj_sel_o_user(mprj_sel_o_user), |
| 417 | .mprj_adr_o_user(mprj_adr_o_user), |
| 418 | .mprj_dat_o_user(mprj_dat_o_user), |
Tim Edwards | 32d0542 | 2020-10-19 19:43:52 -0400 | [diff] [blame] | 419 | .la_data_in_mprj(la_data_in_mprj), |
Tim Edwards | 05ad4fc | 2020-10-19 22:12:33 -0400 | [diff] [blame] | 420 | .user1_vcc_powergood(mprj_vcc_pwrgood), |
| 421 | .user2_vcc_powergood(mprj2_vcc_pwrgood), |
| 422 | .user1_vdd_powergood(mprj_vdd_pwrgood), |
| 423 | .user2_vdd_powergood(mprj2_vdd_pwrgood) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 424 | ); |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 425 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 426 | |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 427 | /*----------------------------------------------*/ |
| 428 | /* Wrapper module around the user project */ |
| 429 | /*----------------------------------------------*/ |
Tim Edwards | 0553751 | 2020-10-06 14:59:26 -0400 | [diff] [blame] | 430 | |
Ahmed Ghazy | 22d29d6 | 2020-10-28 03:42:02 +0200 | [diff] [blame^] | 431 | user_project_wrapper mprj ( |
Tim Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 432 | .vdda1(vdda1), // User area 1 3.3V power |
| 433 | .vdda2(vdda2), // User area 2 3.3V power |
| 434 | .vssa1(vssa1), // User area 1 analog ground |
| 435 | .vssa2(vssa2), // User area 2 analog ground |
| 436 | .vccd1(vccd1), // User area 1 1.8V power |
| 437 | .vccd2(vccd2), // User area 2 1.8V power |
| 438 | .vssd1(vssd1), // User area 1 digital ground |
| 439 | .vssd2(vssd2), // User area 2 digital ground |
| 440 | |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 441 | .wb_clk_i(mprj_clock), |
| 442 | .wb_rst_i(!mprj_resetn), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 443 | // MGMT SoC Wishbone Slave |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 444 | .wbs_cyc_i(mprj_cyc_o_user), |
| 445 | .wbs_stb_i(mprj_stb_o_user), |
| 446 | .wbs_we_i(mprj_we_o_user), |
| 447 | .wbs_sel_i(mprj_sel_o_user), |
| 448 | .wbs_adr_i(mprj_adr_o_user), |
| 449 | .wbs_dat_i(mprj_dat_o_user), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 450 | .wbs_ack_o(mprj_ack_i_core), |
| 451 | .wbs_dat_o(mprj_dat_i_core), |
| 452 | // Logic Analyzer |
| 453 | .la_data_in(la_data_in_mprj), |
| 454 | .la_data_out(la_data_out_mprj), |
| 455 | .la_oen (la_oen), |
| 456 | // IO Pads |
Tim Edwards | 0553751 | 2020-10-06 14:59:26 -0400 | [diff] [blame] | 457 | .io_in (user_io_in), |
Tim Edwards | ef2b68d | 2020-10-11 17:00:44 -0400 | [diff] [blame] | 458 | .io_out(user_io_out), |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 459 | .io_oeb(user_io_oeb), |
| 460 | // Independent clock |
| 461 | .user_clock2(mprj_clock2) |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 462 | ); |
| 463 | |
Tim Edwards | 0553751 | 2020-10-06 14:59:26 -0400 | [diff] [blame] | 464 | /*--------------------------------------*/ |
| 465 | /* End user project instantiation */ |
| 466 | /*--------------------------------------*/ |
| 467 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 468 | wire [`MPRJ_IO_PADS-1:0] gpio_serial_link_shifted; |
| 469 | |
Tim Edwards | 251e0df | 2020-10-05 11:02:12 -0400 | [diff] [blame] | 470 | assign gpio_serial_link_shifted = {gpio_serial_link[`MPRJ_IO_PADS-2:0], mprj_io_loader_data}; |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 471 | |
Tim Edwards | 251e0df | 2020-10-05 11:02:12 -0400 | [diff] [blame] | 472 | // Each control block sits next to an I/O pad in the user area. |
| 473 | // It gets input through a serial chain from the previous control |
| 474 | // block and passes it to the next control block. Due to the nature |
| 475 | // of the shift register, bits are presented in reverse, as the first |
| 476 | // bit in ends up as the last bit of the last I/O pad control block. |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 477 | |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 478 | // There are two types of block; the first two are configured to be |
| 479 | // full bidirectional under control of the management Soc (JTAG and |
| 480 | // SDO). The rest are configured to be default (input). |
| 481 | |
Tim Edwards | 251e0df | 2020-10-05 11:02:12 -0400 | [diff] [blame] | 482 | gpio_control_block #( |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 483 | .DM_INIT(3'b110), // Mode = output, strong up/down |
Tim Edwards | 496a08a | 2020-10-26 15:44:51 -0400 | [diff] [blame] | 484 | .OENB_INIT(1'b1) // Enable output signaling from wire |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 485 | ) gpio_control_bidir [1:0] ( |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 486 | `ifdef LVS |
| 487 | inout vccd, |
| 488 | inout vssd, |
| 489 | inout vccd1, |
| 490 | inout vssd1, |
| 491 | `endif |
Tim Edwards | 44bab47 | 2020-10-04 22:09:54 -0400 | [diff] [blame] | 492 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 493 | // Management Soc-facing signals |
| 494 | |
Tim Edwards | c18c474 | 2020-10-03 11:26:39 -0400 | [diff] [blame] | 495 | .resetn(mprj_io_loader_resetn), |
| 496 | .serial_clock(mprj_io_loader_clock), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 497 | |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 498 | .mgmt_gpio_in(mgmt_io_in[1:0]), |
| 499 | .mgmt_gpio_out({sdo_out, jtag_out}), |
| 500 | .mgmt_gpio_oeb({sdo_outenb, jtag_outenb}), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 501 | |
| 502 | // Serial data chain for pad configuration |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 503 | .serial_data_in(gpio_serial_link_shifted[1:0]), |
| 504 | .serial_data_out(gpio_serial_link[1:0]), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 505 | |
| 506 | // User-facing signals |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 507 | .user_gpio_out(user_io_out[1:0]), |
| 508 | .user_gpio_oeb(user_io_oeb[1:0]), |
| 509 | .user_gpio_in(user_io_in[1:0]), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 510 | |
| 511 | // Pad-facing signals (Pad GPIOv2) |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 512 | .pad_gpio_inenb(mprj_io_inp_dis[1:0]), |
| 513 | .pad_gpio_ib_mode_sel(mprj_io_ib_mode_sel[1:0]), |
| 514 | .pad_gpio_vtrip_sel(mprj_io_vtrip_sel[1:0]), |
| 515 | .pad_gpio_slow_sel(mprj_io_slow_sel[1:0]), |
| 516 | .pad_gpio_holdover(mprj_io_holdover[1:0]), |
| 517 | .pad_gpio_ana_en(mprj_io_analog_en[1:0]), |
| 518 | .pad_gpio_ana_sel(mprj_io_analog_sel[1:0]), |
| 519 | .pad_gpio_ana_pol(mprj_io_analog_pol[1:0]), |
| 520 | .pad_gpio_dm(mprj_io_dm[5:0]), |
| 521 | .pad_gpio_outenb(mprj_io_oeb[1:0]), |
| 522 | .pad_gpio_out(mprj_io_out[1:0]), |
| 523 | .pad_gpio_in(mprj_io_in[1:0]) |
| 524 | ); |
| 525 | |
| 526 | gpio_control_block gpio_control_in [`MPRJ_IO_PADS-1:2] ( |
Tim Edwards | 53d9218 | 2020-10-11 21:47:40 -0400 | [diff] [blame] | 527 | `ifdef LVS |
| 528 | inout vccd, |
| 529 | inout vssd, |
| 530 | inout vccd1, |
| 531 | inout vssd1, |
| 532 | `endif |
Tim Edwards | 89f0924 | 2020-10-05 15:17:34 -0400 | [diff] [blame] | 533 | |
| 534 | // Management Soc-facing signals |
| 535 | |
| 536 | .resetn(mprj_io_loader_resetn), |
| 537 | .serial_clock(mprj_io_loader_clock), |
| 538 | |
| 539 | .mgmt_gpio_in(mgmt_io_in[(`MPRJ_IO_PADS-1):2]), |
| 540 | .mgmt_gpio_out(mgmt_io_in[(`MPRJ_IO_PADS-1):2]), |
| 541 | .mgmt_gpio_oeb(1'b1), |
| 542 | |
| 543 | // Serial data chain for pad configuration |
| 544 | .serial_data_in(gpio_serial_link_shifted[(`MPRJ_IO_PADS-1):2]), |
| 545 | .serial_data_out(gpio_serial_link[(`MPRJ_IO_PADS-1):2]), |
| 546 | |
| 547 | // User-facing signals |
| 548 | .user_gpio_out(user_io_out[(`MPRJ_IO_PADS-1):2]), |
| 549 | .user_gpio_oeb(user_io_oeb[(`MPRJ_IO_PADS-1):2]), |
| 550 | .user_gpio_in(user_io_in[(`MPRJ_IO_PADS-1):2]), |
| 551 | |
| 552 | // Pad-facing signals (Pad GPIOv2) |
| 553 | .pad_gpio_inenb(mprj_io_inp_dis[(`MPRJ_IO_PADS-1):2]), |
| 554 | .pad_gpio_ib_mode_sel(mprj_io_ib_mode_sel[(`MPRJ_IO_PADS-1):2]), |
| 555 | .pad_gpio_vtrip_sel(mprj_io_vtrip_sel[(`MPRJ_IO_PADS-1):2]), |
| 556 | .pad_gpio_slow_sel(mprj_io_slow_sel[(`MPRJ_IO_PADS-1):2]), |
| 557 | .pad_gpio_holdover(mprj_io_holdover[(`MPRJ_IO_PADS-1):2]), |
| 558 | .pad_gpio_ana_en(mprj_io_analog_en[(`MPRJ_IO_PADS-1):2]), |
| 559 | .pad_gpio_ana_sel(mprj_io_analog_sel[(`MPRJ_IO_PADS-1):2]), |
| 560 | .pad_gpio_ana_pol(mprj_io_analog_pol[(`MPRJ_IO_PADS-1):2]), |
| 561 | .pad_gpio_dm(mprj_io_dm[(`MPRJ_IO_PADS*3-1):6]), |
| 562 | .pad_gpio_outenb(mprj_io_oeb[(`MPRJ_IO_PADS-1):2]), |
| 563 | .pad_gpio_out(mprj_io_out[(`MPRJ_IO_PADS-1):2]), |
| 564 | .pad_gpio_in(mprj_io_in[(`MPRJ_IO_PADS-1):2]) |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 565 | ); |
| 566 | |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 567 | sky130_fd_sc_hvl__lsbufhv2lv porb_level ( |
Tim Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 568 | .VPWR(vddio), |
| 569 | .VPB(vddio), |
| 570 | .LVPWR(vccd), |
| 571 | .VNB(vssio), |
| 572 | .VGND(vssio), |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 573 | .A(porb_h), |
| 574 | .X(porb_l) |
| 575 | ); |
| 576 | |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 577 | user_id_programming #( |
| 578 | .USER_PROJECT_ID(USER_PROJECT_ID) |
| 579 | ) user_id_value ( |
Tim Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 580 | .vdd1v8(vccd), |
| 581 | .vss(vssd), |
Tim Edwards | 04ba17f | 2020-10-02 22:27:50 -0400 | [diff] [blame] | 582 | .mask_rev(mask_rev) |
| 583 | ); |
| 584 | |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 585 | // Power-on-reset circuit |
| 586 | simple_por por ( |
Tim Edwards | 9eda80d | 2020-10-08 21:36:44 -0400 | [diff] [blame] | 587 | .vdd3v3(vddio), |
| 588 | .vss(vssio), |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 589 | .porb_h(porb_h) |
| 590 | ); |
| 591 | |
| 592 | // XRES (chip input pin reset) reset level converter |
| 593 | sky130_fd_sc_hvl__lsbufhv2lv rstb_level ( |
Tim Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 594 | .VPWR(vddio), |
| 595 | .VPB(vddio), |
| 596 | .LVPWR(vccd), |
| 597 | .VNB(vssio), |
| 598 | .VGND(vssio), |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 599 | .A(rstb_h), |
| 600 | .X(rstb_l) |
| 601 | ); |
| 602 | |
Tim Edwards | ef8312e | 2020-09-22 17:20:06 -0400 | [diff] [blame] | 603 | endmodule |