|
| 1 | +// *************************************************************************** |
| 2 | +// *************************************************************************** |
| 3 | +// Copyright 2022 (c) 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 responsabilities 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/master/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 | + // ad7190 spi pins |
| 67 | + |
| 68 | + output adc_spi_sclk, |
| 69 | + input adc_spi_miso_rdyn, |
| 70 | + output adc_spi_mosi, |
| 71 | + output adc_spi_csn |
| 72 | +); |
| 73 | + |
| 74 | + // internal signals |
| 75 | + |
| 76 | + wire [63:0] gpio_i; |
| 77 | + wire [63:0] gpio_o; |
| 78 | + wire [63:0] gpio_t; |
| 79 | + |
| 80 | + // instantiations |
| 81 | + |
| 82 | + ad_iobuf #( |
| 83 | + .DATA_WIDTH (2) |
| 84 | + ) i_iobuf_buttons ( |
| 85 | + .dio_t (gpio_t[1:0]), |
| 86 | + .dio_i (gpio_o[1:0]), |
| 87 | + .dio_o (gpio_i[1:0]), |
| 88 | + .dio_p (btn)); |
| 89 | + |
| 90 | + ad_iobuf #( |
| 91 | + .DATA_WIDTH (6) |
| 92 | + ) i_iobuf_leds ( |
| 93 | + .dio_t (gpio_t[7:2]), |
| 94 | + .dio_i (gpio_o[7:2]), |
| 95 | + .dio_o (gpio_i[7:2]), |
| 96 | + .dio_p (led)); |
| 97 | + |
| 98 | + // project specific gpios |
| 99 | + |
| 100 | + assign gpio_i[63:33] = gpio_o[63:33]; |
| 101 | + assign gpio_i[32] = adc_spi_miso_rdyn; |
| 102 | + |
| 103 | + // board specific gpios |
| 104 | + |
| 105 | + assign gpio_i[31:8] = gpio_o[31:8]; |
| 106 | + |
| 107 | + system_wrapper i_system_wrapper ( |
| 108 | + .ddr_addr (ddr_addr), |
| 109 | + .ddr_ba (ddr_ba), |
| 110 | + .ddr_cas_n (ddr_cas_n), |
| 111 | + .ddr_ck_n (ddr_ck_n), |
| 112 | + .ddr_ck_p (ddr_ck_p), |
| 113 | + .ddr_cke (ddr_cke), |
| 114 | + .ddr_cs_n (ddr_cs_n), |
| 115 | + .ddr_dm (ddr_dm), |
| 116 | + .ddr_dq (ddr_dq), |
| 117 | + .ddr_dqs_n (ddr_dqs_n), |
| 118 | + .ddr_dqs_p (ddr_dqs_p), |
| 119 | + .ddr_odt (ddr_odt), |
| 120 | + .ddr_ras_n (ddr_ras_n), |
| 121 | + .ddr_reset_n (ddr_reset_n), |
| 122 | + .ddr_we_n (ddr_we_n), |
| 123 | + |
| 124 | + .fixed_io_ddr_vrn (fixed_io_ddr_vrn), |
| 125 | + .fixed_io_ddr_vrp (fixed_io_ddr_vrp), |
| 126 | + .fixed_io_mio (fixed_io_mio), |
| 127 | + .fixed_io_ps_clk (fixed_io_ps_clk), |
| 128 | + .fixed_io_ps_porb (fixed_io_ps_porb), |
| 129 | + .fixed_io_ps_srstb (fixed_io_ps_srstb), |
| 130 | + |
| 131 | + .gpio_i (gpio_i), |
| 132 | + .gpio_o (gpio_o), |
| 133 | + .gpio_t (gpio_t), |
| 134 | + |
| 135 | + .spi0_clk_i (1'b0), |
| 136 | + .spi0_clk_o (adc_spi_sclk), |
| 137 | + .spi0_csn_0_o (adc_spi_csn), |
| 138 | + .spi0_csn_1_o (), |
| 139 | + .spi0_csn_2_o (), |
| 140 | + .spi0_csn_i (1'b0), |
| 141 | + .spi0_sdi_i (adc_spi_miso_rdyn), |
| 142 | + .spi0_sdo_i (1'b0), |
| 143 | + .spi0_sdo_o (adc_spi_mosi), |
| 144 | + |
| 145 | + .spi1_clk_i (1'b0), |
| 146 | + .spi1_clk_o (), |
| 147 | + .spi1_csn_0_o (), |
| 148 | + .spi1_csn_1_o (), |
| 149 | + .spi1_csn_2_o (), |
| 150 | + .spi1_csn_i (1'b1), |
| 151 | + .spi1_sdi_i (1'b0), |
| 152 | + .spi1_sdo_i (1'b0), |
| 153 | + .spi1_sdo_o ()); |
| 154 | + |
| 155 | +endmodule |
0 commit comments