|
| 1 | +// *************************************************************************** |
| 2 | +// *************************************************************************** |
| 3 | +// Copyright (C) 2025 Analog Devices, Inc. All rights reserved. |
| 4 | +// |
| 5 | +// In this HDL repository, there are many different and unique modules, consisting |
| 6 | +// of various HDL (Verilog or VHDL) components. The individual modules are |
| 7 | +// developed independently, and may be accompanied by separate and unique license |
| 8 | +// terms. |
| 9 | +// |
| 10 | +// The user should read each of these license terms, and understand the |
| 11 | +// freedoms and responsibilities that he or she has by using this source/core. |
| 12 | +// |
| 13 | +// This core is distributed in the hope that it will be useful, but WITHOUT ANY |
| 14 | +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 15 | +// A PARTICULAR PURPOSE. |
| 16 | +// |
| 17 | +// Redistribution and use of source or resulting binaries, with or without modification |
| 18 | +// of this file, are permitted under one of the following two license terms: |
| 19 | +// |
| 20 | +// 1. The GNU General Public License version 2 as published by the |
| 21 | +// Free Software Foundation, which can be found in the top level directory |
| 22 | +// of this repository (LICENSE_GPL2), and also online at: |
| 23 | +// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> |
| 24 | +// |
| 25 | +// OR |
| 26 | +// |
| 27 | +// 2. An ADI specific BSD license, which can be found in the top level directory |
| 28 | +// of this repository (LICENSE_ADIBSD), and also on-line at: |
| 29 | +// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD |
| 30 | +// This will allow to generate bit files and not release the source code, |
| 31 | +// as long as it attaches to an ADI device. |
| 32 | +// |
| 33 | +// *************************************************************************** |
| 34 | +// *************************************************************************** |
| 35 | + |
| 36 | +`timescale 1ns/100ps |
| 37 | + |
| 38 | +module system_top ( |
| 39 | + |
| 40 | + inout [14:0] ddr_addr, |
| 41 | + inout [ 2:0] ddr_ba, |
| 42 | + inout ddr_cas_n, |
| 43 | + inout ddr_ck_n, |
| 44 | + inout ddr_ck_p, |
| 45 | + inout ddr_cke, |
| 46 | + inout ddr_cs_n, |
| 47 | + inout [ 3:0] ddr_dm, |
| 48 | + inout [31:0] ddr_dq, |
| 49 | + inout [ 3:0] ddr_dqs_n, |
| 50 | + inout [ 3:0] ddr_dqs_p, |
| 51 | + inout ddr_odt, |
| 52 | + inout ddr_ras_n, |
| 53 | + inout ddr_reset_n, |
| 54 | + inout ddr_we_n, |
| 55 | + |
| 56 | + inout fixed_io_ddr_vrn, |
| 57 | + inout fixed_io_ddr_vrp, |
| 58 | + inout [53:0] fixed_io_mio, |
| 59 | + inout fixed_io_ps_clk, |
| 60 | + inout fixed_io_ps_porb, |
| 61 | + inout fixed_io_ps_srstb, |
| 62 | + |
| 63 | + inout [ 1:0] btn, |
| 64 | + inout [ 5:0] led, |
| 65 | + |
| 66 | + output iic_ard_scl, |
| 67 | + inout iic_ard_sda, |
| 68 | + |
| 69 | + inout adc_gp1, |
| 70 | + inout adc_gp0 |
| 71 | +); |
| 72 | + |
| 73 | + // internal signals |
| 74 | + |
| 75 | + wire [63:0] gpio_i; |
| 76 | + wire [63:0] gpio_o; |
| 77 | + wire [63:0] gpio_t; |
| 78 | + wire i3c_sdo; |
| 79 | + wire i3c_sdi; |
| 80 | + wire i3c_t; |
| 81 | + |
| 82 | + // instantiations |
| 83 | + |
| 84 | + assign gpio_i[31:8] = gpio_o[31:8]; |
| 85 | + assign gpio_i[63:34] = gpio_o[63:34]; |
| 86 | + |
| 87 | + ad_iobuf #( |
| 88 | + .DATA_WIDTH(2) |
| 89 | + ) i_iobuf_gp ( |
| 90 | + .dio_t(gpio_t[33:32]), |
| 91 | + .dio_i(gpio_o[33:32]), |
| 92 | + .dio_o(gpio_i[33:32]), |
| 93 | + .dio_p({adc_gp1, // device ready then ~data ready |
| 94 | + adc_gp0})); // threshold event |
| 95 | + |
| 96 | + ad_iobuf #( |
| 97 | + .DATA_WIDTH(1) |
| 98 | + ) i_iobuf_sda ( |
| 99 | + .dio_t(i3c_t), |
| 100 | + .dio_i(i3c_sdo), |
| 101 | + .dio_o(i3c_sdi), |
| 102 | + .dio_p(iic_ard_sda)); |
| 103 | + |
| 104 | + ad_iobuf #( |
| 105 | + .DATA_WIDTH(2) |
| 106 | + ) i_iobuf_buttons ( |
| 107 | + .dio_t(gpio_t[1:0]), |
| 108 | + .dio_i(gpio_o[1:0]), |
| 109 | + .dio_o(gpio_i[1:0]), |
| 110 | + .dio_p(btn)); |
| 111 | + |
| 112 | + ad_iobuf #( |
| 113 | + .DATA_WIDTH(6) |
| 114 | + ) i_iobuf_leds ( |
| 115 | + .dio_t(gpio_t[7:2]), |
| 116 | + .dio_i(gpio_o[7:2]), |
| 117 | + .dio_o(gpio_i[7:2]), |
| 118 | + .dio_p(led)); |
| 119 | + |
| 120 | + system_wrapper i_system_wrapper ( |
| 121 | + .ddr_addr (ddr_addr), |
| 122 | + .ddr_ba (ddr_ba), |
| 123 | + .ddr_cas_n (ddr_cas_n), |
| 124 | + .ddr_ck_n (ddr_ck_n), |
| 125 | + .ddr_ck_p (ddr_ck_p), |
| 126 | + .ddr_cke (ddr_cke), |
| 127 | + .ddr_cs_n (ddr_cs_n), |
| 128 | + .ddr_dm (ddr_dm), |
| 129 | + .ddr_dq (ddr_dq), |
| 130 | + .ddr_dqs_n (ddr_dqs_n), |
| 131 | + .ddr_dqs_p (ddr_dqs_p), |
| 132 | + .ddr_odt (ddr_odt), |
| 133 | + .ddr_ras_n (ddr_ras_n), |
| 134 | + .ddr_reset_n (ddr_reset_n), |
| 135 | + .ddr_we_n (ddr_we_n), |
| 136 | + .fixed_io_ddr_vrn (fixed_io_ddr_vrn), |
| 137 | + .fixed_io_ddr_vrp (fixed_io_ddr_vrp), |
| 138 | + .fixed_io_mio (fixed_io_mio), |
| 139 | + .fixed_io_ps_clk (fixed_io_ps_clk), |
| 140 | + .fixed_io_ps_porb (fixed_io_ps_porb), |
| 141 | + .fixed_io_ps_srstb (fixed_io_ps_srstb), |
| 142 | + .gpio_i (gpio_i), |
| 143 | + .gpio_o (gpio_o), |
| 144 | + .gpio_t (gpio_t), |
| 145 | + .spi0_clk_i (1'b0), |
| 146 | + .spi0_clk_o (), |
| 147 | + .spi0_csn_0_o (), |
| 148 | + .spi0_csn_1_o (), |
| 149 | + .spi0_csn_2_o (), |
| 150 | + .spi0_csn_i (1'b1), |
| 151 | + .spi0_sdi_i (1'b0), |
| 152 | + .spi0_sdo_i (1'b0), |
| 153 | + .spi0_sdo_o (), |
| 154 | + .spi1_clk_i (1'b0), |
| 155 | + .spi1_clk_o (), |
| 156 | + .spi1_csn_0_o (), |
| 157 | + .spi1_csn_1_o (), |
| 158 | + .spi1_csn_2_o (), |
| 159 | + .spi1_csn_i (1'b1), |
| 160 | + .spi1_sdi_i (1'b0), |
| 161 | + .spi1_sdo_i (1'b0), |
| 162 | + .spi1_sdo_o (), |
| 163 | + .i3c_scl (iic_ard_scl), |
| 164 | + .i3c_sdi (i3c_sdi), |
| 165 | + .i3c_sdo (i3c_sdo), |
| 166 | + .i3c_t (i3c_t)); |
| 167 | + |
| 168 | +endmodule |
0 commit comments