prcfg: common files

main
Rejeesh Kutty 2015-05-01 11:48:09 -04:00
parent a8d4c916c1
commit 140c622c8b
3 changed files with 268 additions and 0 deletions

View File

@ -0,0 +1,146 @@
// ***************************************************************************
// ***************************************************************************
// Copyright 2013 (c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// - Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// - Neither the name of Analog Devices, Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// - The use of this software may or may not infringe the patent rights
// of one or more patent holders. This license does not release you
// from the requirement that you obtain separate licenses from these
// patent holders to use this software.
// - Use of the software either in source or binary form, must be run
// on or directly connected to an Analog Devices Inc. component.
//
// THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED.
//
// IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY
// RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/1ns
module prcfg (
clk,
// gpio
dac_gpio_input,
dac_gpio_output,
adc_gpio_input,
adc_gpio_output,
// tx side
dma_dac_en,
dma_dac_dvalid,
dma_dac_ddata,
dma_dac_dunf,
core_dac_en,
core_dac_dvalid,
core_dac_ddata,
core_dac_dunf,
// rx side
core_adc_dwr,
core_adc_dsync,
core_adc_ddata,
core_adc_ovf,
dma_adc_dwr,
dma_adc_dsync,
dma_adc_ddata,
dma_adc_ovf);
input clk;
// gpio
input [31:0] adc_gpio_input;
output [31:0] adc_gpio_output;
input [31:0] dac_gpio_input;
output [31:0] dac_gpio_output;
// tx side
output dma_dac_en;
input dma_dac_dvalid;
input [63:0] dma_dac_ddata;
input dma_dac_dunf;
input core_dac_en;
output core_dac_dvalid;
output [63:0] core_dac_ddata;
output core_dac_dunf;
// rx side
input core_adc_dwr;
input core_adc_dsync;
input [63:0] core_adc_ddata;
output core_adc_ovf;
output dma_adc_dwr;
output dma_adc_dsync;
output [63:0] dma_adc_ddata;
input dma_adc_ovf;
// fmcomms2 configuration
localparam NUM_OF_CHANNELS = 2;
localparam ADC_ENABLE = 1;
localparam DAC_ENABLE = 1;
// default top
prcfg_top # (
.NUM_CHANNEL (NUM_OF_CHANNELS),
.ADC_EN (ADC_ENABLE),
.DAC_EN (DAC_ENABLE))
i_prcfg_top (
.clk (clk),
.adc_gpio_input (adc_gpio_input),
.adc_gpio_output (adc_gpio_output),
.dac_gpio_input (dac_gpio_input),
.dac_gpio_output (dac_gpio_output),
.dma_dac_en (dma_dac_en),
.dma_dac_dunf (dma_dac_dunf),
.dma_dac_ddata (dma_dac_ddata),
.dma_dac_dvalid (dma_dac_dvalid),
.core_dac_en (core_dac_en),
.core_dac_dunf (core_dac_dunf),
.core_dac_ddata (core_dac_ddata),
.core_dac_dvalid (core_dac_dvalid),
.core_adc_dwr (core_adc_dwr),
.core_adc_dsync (core_adc_dsync),
.core_adc_ddata (core_adc_ddata),
.core_adc_ovf (core_adc_ovf),
.dma_adc_dwr (dma_adc_dwr),
.dma_adc_dsync (dma_adc_dsync),
.dma_adc_ddata (dma_adc_ddata),
.dma_adc_ovf (dma_adc_ovf));
endmodule
// ***************************************************************************
// ***************************************************************************

View File

@ -0,0 +1,16 @@
create_pblock pb_prcfg
add_cells_to_pblock [get_pblocks pb_prcfg] [get_cells -quiet [list i_prcfg]]
resize_pblock [get_pblocks pb_prcfg] -add {SLICE_X90Y0:SLICE_X161Y149}
resize_pblock [get_pblocks pb_prcfg] -add {SLICE_X90Y150:SLICE_X122Y199}
resize_pblock [get_pblocks pb_prcfg] -add {RAMB18_X4Y0:RAMB18_X7Y59}
resize_pblock [get_pblocks pb_prcfg] -add {RAMB18_X4Y60:RAMB18_X4Y79}
resize_pblock [get_pblocks pb_prcfg] -add {RAMB36_X4Y0:RAMB36_X7Y29}
resize_pblock [get_pblocks pb_prcfg] -add {DSP48_X4Y0:DSP48_X6Y59}
resize_pblock [get_pblocks pb_prcfg] -add {DSP48_X4Y60:DSP48_X4Y79}
set_property SNAPPING_MODE ON [get_pblocks pb_prcfg]
set_property RESET_AFTER_RECONFIG 1 [get_pblocks pb_prcfg]

View File

@ -0,0 +1,106 @@
# prcfg io
create_bd_port -dir O clk
create_bd_port -dir I dma_dac_en
create_bd_port -dir O dma_dac_dvalid
create_bd_port -dir O -from 63 -to 0 dma_dac_ddata
create_bd_port -dir O dma_dac_dunf
create_bd_port -dir O core_dac_en
create_bd_port -dir I core_dac_dvalid
create_bd_port -dir I -from 63 -to 0 core_dac_ddata
create_bd_port -dir I core_dac_dunf
create_bd_port -dir O core_adc_dwr
create_bd_port -dir O core_adc_dsync
create_bd_port -dir O -from 63 -to 0 core_adc_ddata
create_bd_port -dir I core_adc_ovf
create_bd_port -dir I dma_adc_dwr
create_bd_port -dir I dma_adc_dsync
create_bd_port -dir I -from 63 -to 0 dma_adc_ddata
create_bd_port -dir O dma_adc_ovf
create_bd_port -dir I -from 31 -to 0 up_dac_gpio_in
create_bd_port -dir I -from 31 -to 0 up_adc_gpio_in
create_bd_port -dir O -from 31 -to 0 up_dac_gpio_out
create_bd_port -dir O -from 31 -to 0 up_adc_gpio_out
# re-wiring
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_dac_dma/fifo_rd_en]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_dac_dma/fifo_rd_valid]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_dac_dma/fifo_rd_dout]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_dac_dma/fifo_rd_underflow]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_adc_dma/fifo_wr_en]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_adc_dma/fifo_wr_sync]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_adc_dma/fifo_wr_din]]
delete_bd_objs [get_bd_nets -of_objects [get_bd_pins axi_ad9361_adc_dma/fifo_wr_overflow]]
ad_connect clk axi_ad9361/clk
ad_connect dma_dac_en axi_ad9361_dac_dma/fifo_rd_en
ad_connect dma_dac_dvalid axi_ad9361_dac_dma/fifo_rd_valid
ad_connect dma_dac_ddata axi_ad9361_dac_dma/fifo_rd_dout
ad_connect dma_dac_dunf axi_ad9361_dac_dma/fifo_rd_underflow
ad_connect core_dac_en util_dac_unpack/dma_rd
ad_connect core_dac_dvalid util_dac_unpack/fifo_valid
ad_connect core_dac_ddata util_dac_unpack/dma_data
ad_connect core_dac_dunf axi_ad9361/dac_dunf
ad_connect up_dac_gpio_in axi_ad9361/up_dac_gpio_in
ad_connect up_dac_gpio_out axi_ad9361/up_dac_gpio_out
ad_connect dma_adc_dwr axi_ad9361_adc_dma/fifo_wr_en
ad_connect dma_adc_dsync axi_ad9361_adc_dma/fifo_wr_sync
ad_connect dma_adc_ddata axi_ad9361_adc_dma/fifo_wr_din
ad_connect dma_adc_ovf axi_ad9361_adc_dma/fifo_wr_overflow
ad_connect core_adc_dwr util_adc_pack/dvalid
ad_connect core_adc_dsync util_adc_pack/dsync
ad_connect core_adc_ddata util_adc_pack/ddata
ad_connect core_adc_ovf axi_ad9361/adc_dovf
ad_connect up_adc_gpio_in axi_ad9361/up_adc_gpio_in
ad_connect up_adc_gpio_out axi_ad9361/up_adc_gpio_out
# monitoring
set ila_adc_core [create_bd_cell -type ip -vlnv xilinx.com:ip:ila:5.0 ila_adc_core]
set_property -dict [list CONFIG.C_MONITOR_TYPE {Native}] $ila_adc_core
set_property -dict [list CONFIG.C_NUM_OF_PROBES {2}] $ila_adc_core
set_property -dict [list CONFIG.C_PROBE0_WIDTH {1}] $ila_adc_core
set_property -dict [list CONFIG.C_PROBE1_WIDTH {64}] $ila_adc_core
set_property -dict [list CONFIG.C_EN_STRG_QUAL {1}] $ila_adc_core
ad_connect clk ila_adc_core/clk
ad_connect util_adc_pack/dvalid ila_adc_core/probe0
ad_connect util_adc_pack/ddata ila_adc_core/probe1
set ila_dac_core [create_bd_cell -type ip -vlnv xilinx.com:ip:ila:5.0 ila_dac_core]
set_property -dict [list CONFIG.C_MONITOR_TYPE {Native}] $ila_dac_core
set_property -dict [list CONFIG.C_NUM_OF_PROBES {2}] $ila_dac_core
set_property -dict [list CONFIG.C_PROBE0_WIDTH {1}] $ila_dac_core
set_property -dict [list CONFIG.C_PROBE1_WIDTH {64}] $ila_dac_core
set_property -dict [list CONFIG.C_EN_STRG_QUAL {1}] $ila_dac_core
ad_connect clk ila_dac_core/clk
ad_connect util_dac_unpack/fifo_valid ila_dac_core/probe0
ad_connect util_dac_unpack/dma_data ila_dac_core/probe1
set ila_adc_dma [create_bd_cell -type ip -vlnv xilinx.com:ip:ila:5.0 ila_adc_dma]
set_property -dict [list CONFIG.C_MONITOR_TYPE {Native}] $ila_adc_dma
set_property -dict [list CONFIG.C_NUM_OF_PROBES {2}] $ila_adc_dma
set_property -dict [list CONFIG.C_PROBE0_WIDTH {1}] $ila_adc_dma
set_property -dict [list CONFIG.C_PROBE1_WIDTH {64}] $ila_adc_dma
set_property -dict [list CONFIG.C_EN_STRG_QUAL {1}] $ila_adc_dma
ad_connect clk ila_adc_dma/clk
ad_connect axi_ad9361_adc_dma/fifo_wr_en ila_adc_dma/probe0
ad_connect axi_ad9361_adc_dma/fifo_wr_din ila_adc_dma/probe1
set ila_dac_dma [create_bd_cell -type ip -vlnv xilinx.com:ip:ila:5.0 ila_dac_dma]
set_property -dict [list CONFIG.C_MONITOR_TYPE {Native}] $ila_dac_dma
set_property -dict [list CONFIG.C_NUM_OF_PROBES {2}] $ila_dac_dma
set_property -dict [list CONFIG.C_PROBE0_WIDTH {1}] $ila_dac_dma
set_property -dict [list CONFIG.C_PROBE1_WIDTH {64}] $ila_dac_dma
set_property -dict [list CONFIG.C_EN_STRG_QUAL {1}] $ila_dac_dma
ad_connect clk ila_dac_dma/clk
ad_connect axi_ad9361_dac_dma/fifo_rd_en ila_dac_dma/probe0
ad_connect axi_ad9361_dac_dma/fifo_rd_dout ila_dac_dma/probe1