ad9625x2_fmc: Integrate the dac spi interface into the SPI interface

main
Istvan Csomortani 2014-12-03 12:01:47 +02:00
parent 805d52346c
commit 757c213165
2 changed files with 21 additions and 22 deletions

View File

@ -1,8 +1,8 @@
# ad9625 # ad9625
set spi_csn_o [create_bd_port -dir O -from 1 -to 0 spi_csn_o] set spi_csn_o [create_bd_port -dir O -from 3 -to 0 spi_csn_o]
set spi_csn_i [create_bd_port -dir I -from 1 -to 0 spi_csn_i] set spi_csn_i [create_bd_port -dir I -from 3 -to 0 spi_csn_i]
set spi_clk_i [create_bd_port -dir I spi_clk_i] set spi_clk_i [create_bd_port -dir I spi_clk_i]
set spi_clk_o [create_bd_port -dir O spi_clk_o] set spi_clk_o [create_bd_port -dir O spi_clk_o]
set spi_sdo_i [create_bd_port -dir I spi_sdo_i] set spi_sdo_i [create_bd_port -dir I spi_sdo_i]
@ -91,12 +91,12 @@ set_property -dict [list CONFIG.C_DMA_DATA_WIDTH_DEST {64}] $axi_ad9625_dma
set axi_ad9625_gpio [create_bd_cell -type ip -vlnv xilinx.com:ip:axi_gpio:2.0 axi_ad9625_gpio] set axi_ad9625_gpio [create_bd_cell -type ip -vlnv xilinx.com:ip:axi_gpio:2.0 axi_ad9625_gpio]
set_property -dict [list CONFIG.C_IS_DUAL {0}] $axi_ad9625_gpio set_property -dict [list CONFIG.C_IS_DUAL {0}] $axi_ad9625_gpio
set_property -dict [list CONFIG.C_GPIO_WIDTH {19}] $axi_ad9625_gpio set_property -dict [list CONFIG.C_GPIO_WIDTH {15}] $axi_ad9625_gpio
set_property -dict [list CONFIG.C_INTERRUPT_PRESENT {1}] $axi_ad9625_gpio set_property -dict [list CONFIG.C_INTERRUPT_PRESENT {1}] $axi_ad9625_gpio
set axi_ad9625_spi [create_bd_cell -type ip -vlnv xilinx.com:ip:axi_quad_spi:3.2 axi_ad9625_spi] set axi_ad9625_spi [create_bd_cell -type ip -vlnv xilinx.com:ip:axi_quad_spi:3.2 axi_ad9625_spi]
set_property -dict [list CONFIG.C_USE_STARTUP {0}] $axi_ad9625_spi set_property -dict [list CONFIG.C_USE_STARTUP {0}] $axi_ad9625_spi
set_property -dict [list CONFIG.C_NUM_SS_BITS {2}] $axi_ad9625_spi set_property -dict [list CONFIG.C_NUM_SS_BITS {4}] $axi_ad9625_spi
set_property -dict [list CONFIG.C_SCK_RATIO {8}] $axi_ad9625_spi set_property -dict [list CONFIG.C_SCK_RATIO {8}] $axi_ad9625_spi
p_sys_dmafifo [current_bd_instance .] axi_ad9625_fifo 512 10 p_sys_dmafifo [current_bd_instance .] axi_ad9625_fifo 512 10

View File

@ -222,16 +222,16 @@ module system_top (
output spi_clk; output spi_clk;
inout spi_sdio; inout spi_sdio;
output spi_dirn; output spi_dirn;
output dac_clk;
output dac_data;
output dac_sync_0;
output dac_sync_1;
input trig_p; input trig_p;
input trig_n; input trig_n;
output vdither_p; output vdither_p;
output vdither_n; output vdither_n;
inout pwr_good; inout pwr_good;
inout dac_clk;
inout dac_data;
inout dac_sync_0;
inout dac_sync_1;
inout fd_1; inout fd_1;
inout irq_1; inout irq_1;
inout fd_0; inout fd_0;
@ -344,22 +344,18 @@ module system_top (
IBUFDS i_ibufds_trig ( IBUFDS i_ibufds_trig (
.I (trig_p), .I (trig_p),
.IB (trig_n), .IB (trig_n),
.O (gpio_i[18])); .O (gpio_i[14]));
OBUFDS i_obufds_vdither ( OBUFDS i_obufds_vdither (
.I (gpio_o[17]), .I (gpio_o[13]),
.O (vdither_p), .O (vdither_p),
.OB (vdither_n)); .OB (vdither_n));
ad_iobuf #(.DATA_WIDTH(17)) i_iobuf ( ad_iobuf #(.DATA_WIDTH(13)) i_iobuf (
.dt (gpio_t[16:0]), .dt (gpio_t[12:0]),
.di (gpio_o[16:0]), .di (gpio_o[12:0]),
.do (gpio_i[16:0]), .do (gpio_i[12:0]),
.dio ({ pwr_good, // 16 .dio ({ pwr_good, // 12
dac_clk, // 15
dac_data, // 14
dac_sync_0, // 13
dac_sync_1, // 12
fd_1, // 11 fd_1, // 11
irq_1, // 10 irq_1, // 10
fd_0, // 9 fd_0, // 9
@ -382,6 +378,9 @@ module system_top (
.spi_sdio (spi_sdio), .spi_sdio (spi_sdio),
.spi_dirn (spi_dirn)); .spi_dirn (spi_dirn));
assign dac_clk = spi_clk;
assign dac_data = spi_mosi;
assign fan_pwm = 1'b1; assign fan_pwm = 1'b1;
system_wrapper i_system_wrapper ( system_wrapper i_system_wrapper (
@ -476,8 +475,8 @@ module system_top (
.spdif (spdif), .spdif (spdif),
.spi_clk_i (1'b0), .spi_clk_i (1'b0),
.spi_clk_o (spi_clk), .spi_clk_o (spi_clk),
.spi_csn_i (2'b11), .spi_csn_i (4'b1111),
.spi_csn_o ({spi_csn_1, spi_csn_0}), .spi_csn_o ({dac_sync_1, dac_sync_0, spi_csn_1, spi_csn_0}),
.spi_sdi_i (spi_miso), .spi_sdi_i (spi_miso),
.spi_sdo_i (1'b0), .spi_sdo_i (1'b0),
.spi_sdo_o (spi_mosi), .spi_sdo_o (spi_mosi),