From dc00ba946b8d7ca29979431051d1eacf0d8e3218 Mon Sep 17 00:00:00 2001 From: Jorge Marques Date: Tue, 5 Nov 2024 11:39:42 -0300 Subject: [PATCH] V2: Add i2c por for evb eeprom Signed-off-by: Jorge Marques --- projects/ad4052_ardz/common/ad4052_bd.tcl | 8 ++++++++ .../ad4052_ardz/common/eval_ad4052_ardz.txt | 18 ++++++++++-------- projects/ad4052_ardz/coraz7s/system_constr.xdc | 16 +++++++++------- projects/ad4052_ardz/coraz7s/system_top.v | 13 +++++++++---- .../ad4052_ardz/de10nano/system_project.tcl | 9 +++++++++ projects/ad4052_ardz/de10nano/system_top.v | 15 +++++++++++++++ 6 files changed, 60 insertions(+), 19 deletions(-) diff --git a/projects/ad4052_ardz/common/ad4052_bd.tcl b/projects/ad4052_ardz/common/ad4052_bd.tcl index 57a6c348570..6d5d36964cf 100644 --- a/projects/ad4052_ardz/common/ad4052_bd.tcl +++ b/projects/ad4052_ardz/common/ad4052_bd.tcl @@ -5,6 +5,8 @@ create_bd_port -dir O adc_cnv create_bd_intf_port -mode Master -vlnv analog.com:interface:spi_engine_rtl:1.0 adc_spi +create_bd_intf_port -mode Master -vlnv xilinx.com:interface:iic_rtl:1.0 iic_eeprom + source $ad_hdl_dir/library/spi_engine/scripts/spi_engine.tcl set data_width 32 @@ -28,6 +30,8 @@ ad_ip_instance axi_pwm_gen adc_trigger_gen ad_ip_parameter adc_trigger_gen CONFIG.PULSE_0_PERIOD 120 ad_ip_parameter adc_trigger_gen CONFIG.PULSE_0_WIDTH 1 +ad_ip_instance axi_iic axi_iic_eeprom + # dma to receive data stream ad_ip_instance axi_dmac axi_adc_dma ad_ip_parameter axi_adc_dma CONFIG.DMA_TYPE_SRC 1 @@ -71,14 +75,18 @@ ad_connect spi_clk axi_adc_dma/s_axis_aclk ad_connect sys_cpu_resetn $hier_spi_engine/resetn ad_connect sys_cpu_resetn axi_adc_dma/m_dest_axi_aresetn +ad_connect iic_eeprom axi_iic_eeprom/iic + ad_cpu_interconnect 0x44a00000 $hier_spi_engine/${hier_spi_engine}_axi_regmap ad_cpu_interconnect 0x44a30000 axi_adc_dma +ad_cpu_interconnect 0x44a40000 axi_iic_eeprom ad_cpu_interconnect 0x44a70000 spi_clkgen ad_cpu_interconnect 0x44b00000 adc_trigger_gen ad_cpu_interrupt "ps-14" "mb-14" intr_slice_0/Dout ad_cpu_interrupt "ps-13" "mb-13" axi_adc_dma/irq ad_cpu_interrupt "ps-12" "mb-12" /$hier_spi_engine/irq +ad_cpu_interrupt "ps-11" "mb-11" axi_iic_eeprom/iic2intc_irpt ad_mem_hp1_interconnect $sys_cpu_clk sys_ps7/S_AXI_HP1 ad_mem_hp1_interconnect $sys_cpu_clk axi_adc_dma/m_dest_axi diff --git a/projects/ad4052_ardz/common/eval_ad4052_ardz.txt b/projects/ad4052_ardz/common/eval_ad4052_ardz.txt index 6a684de4e09..7c464fed921 100644 --- a/projects/ad4052_ardz/common/eval_ad4052_ardz.txt +++ b/projects/ad4052_ardz/common/eval_ad4052_ardz.txt @@ -1,11 +1,13 @@ -Header/Pin Port Schematic_name System_top_name IOSTANDARD Termination +Header/Pin Schematic_name Device.Pin System_top_name IOSTANDARD Termination # eval_ad4052_ardz -P3.6 SCLK_ARD SCLK adc_spi_sclk LVCMOS33 IOB TRUE -P3.5 MISO_ARD SDO adc_spi_sdi LVCMOS33 IOB TRUE -P3.4 MOSI_ARD SDI adc_spi_sdo LVCMOS33 IOB TRUE -P3.3 CSB_ARD CSB adc_spi_cs LVCMOS33 IOB TRUE -P4.7 CNV_ARD CNV adc_spi_cnv LVCMOS33 IOB TRUE -P3.2 D9_ARD GP0 adc_spi_gpio0 LVCMOS33 #N/A -P3.1 D8_ARD GP1 adc_spi_gpio1 LVCMOS33 #N/A +P3.10 SCL_ARD EEPROM.SCL iic_eeprom_scl LVCMOS33 #N/A +P3.9 SDA_ARD EEPROM.SDA iic_eeprom_sda LVCMOS33 #N/A +P3.6 SCLK_ARD AD4052.SCLK adc_spi_sclk LVCMOS33 IOB TRUE +P3.5 MISO_ARD AD4052.SDO adc_spi_sdi LVCMOS33 IOB TRUE +P3.4 MOSI_ARD AD4052.SDI adc_spi_sdo LVCMOS33 IOB TRUE +P3.3 CSB_ARD AD4052.CSB adc_spi_cs LVCMOS33 IOB TRUE +P4.7 CNV_ARD AD4052.CNV adc_spi_cnv LVCMOS33 IOB TRUE +P3.2 D9_ARD AD4052.GP0 adc_spi_gpio0 LVCMOS33 #N/A +P3.1 D8_ARD AD4052.GP1 adc_spi_gpio1 LVCMOS33 #N/A diff --git a/projects/ad4052_ardz/coraz7s/system_constr.xdc b/projects/ad4052_ardz/coraz7s/system_constr.xdc index 33422daac1e..c29c74ad819 100644 --- a/projects/ad4052_ardz/coraz7s/system_constr.xdc +++ b/projects/ad4052_ardz/coraz7s/system_constr.xdc @@ -4,13 +4,15 @@ ############################################################################### # ADC SPI interface -set_property -dict {PACKAGE_PIN G15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sclk] ; ## Arduino_IO13 -set_property -dict {PACKAGE_PIN J18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdi] ; ## Arduino_IO12 -set_property -dict {PACKAGE_PIN K18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdo] ; ## Arduino_IO11 -set_property -dict {PACKAGE_PIN U15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_cs] ; ## Arduino_IO10 -set_property -dict {PACKAGE_PIN R17 IOSTANDARD LVCMOS33} [get_ports adc_cnv] ; ## Arduino_IO06 -set_property -dict {PACKAGE_PIN M18 IOSTANDARD LVCMOS33} [get_ports adc_gp0] ; ## Arduino_IO09 -set_property -dict {PACKAGE_PIN N18 IOSTANDARD LVCMOS33} [get_ports adc_gp1] ; ## Arduino_IO08 +set_property -dict {PACKAGE_PIN P16 IOSTANDARD LVCMOS33} [get_ports iic_eeprom_scl] ; ## Arduino_SCL +set_property -dict {PACKAGE_PIN P15 IOSTANDARD LVCMOS33} [get_ports iic_eeprom_sda] ; ## Arduino_SDA +set_property -dict {PACKAGE_PIN G15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sclk] ; ## Arduino_IO13 +set_property -dict {PACKAGE_PIN J18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdi] ; ## Arduino_IO12 +set_property -dict {PACKAGE_PIN K18 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_sdo] ; ## Arduino_IO11 +set_property -dict {PACKAGE_PIN U15 IOSTANDARD LVCMOS33 IOB TRUE} [get_ports adc_spi_cs] ; ## Arduino_IO10 +set_property -dict {PACKAGE_PIN R17 IOSTANDARD LVCMOS33} [get_ports adc_cnv] ; ## Arduino_IO06 +set_property -dict {PACKAGE_PIN M18 IOSTANDARD LVCMOS33} [get_ports adc_gp0] ; ## Arduino_IO09 +set_property -dict {PACKAGE_PIN N18 IOSTANDARD LVCMOS33} [get_ports adc_gp1] ; ## Arduino_IO08 # rename auto-generated clock for SPIEngine to spi_clk - 160MHz # NOTE: clk_fpga_0 is the first PL fabric clock, also called $sys_cpu_clk diff --git a/projects/ad4052_ardz/coraz7s/system_top.v b/projects/ad4052_ardz/coraz7s/system_top.v index 02b6ba37436..bbb52d57a36 100644 --- a/projects/ad4052_ardz/coraz7s/system_top.v +++ b/projects/ad4052_ardz/coraz7s/system_top.v @@ -60,16 +60,19 @@ module system_top ( inout fixed_io_ps_porb, inout fixed_io_ps_srstb, + inout [ 1:0] btn, + inout [ 5:0] led, + + inout iic_eeprom_scl, + inout iic_eeprom_sda, + output adc_spi_sclk, input adc_spi_sdi, output adc_spi_sdo, output adc_spi_cs, output adc_cnv, inout adc_gp0, - inout adc_gp1, - - inout [ 1:0] btn, - inout [ 5:0] led + inout adc_gp1 ); // internal signals @@ -155,6 +158,8 @@ module system_top ( .spi1_sdi_i (1'b0), .spi1_sdo_i (1'b0), .spi1_sdo_o (), + .iic_eeprom_scl_io(iic_eeprom_scl), + .iic_eeprom_sda_io(iic_eeprom_sda), .adc_spi_sclk(adc_spi_sclk), .adc_spi_sdi(adc_spi_sdi), .adc_spi_sdo(adc_spi_sdo), diff --git a/projects/ad4052_ardz/de10nano/system_project.tcl b/projects/ad4052_ardz/de10nano/system_project.tcl index a634a4fcdde..d6f0ffe4457 100644 --- a/projects/ad4052_ardz/de10nano/system_project.tcl +++ b/projects/ad4052_ardz/de10nano/system_project.tcl @@ -12,6 +12,11 @@ adi_project ad4052_ardz_de10nano source $ad_hdl_dir/projects/common/de10nano/de10nano_system_assign.tcl +# eeprom + +set_location_assignment PIN_AH9 -to i2c_sda ; ## Arduino_SDA +set_location_assignment PIN_AG11 -to i2c_scl ; ## Arduino_SCL + # ad4052 interface set_location_assignment PIN_AH12 -to adc_spi_sclk ; ## Arduino_IO13 @@ -22,6 +27,10 @@ set_location_assignment PIN_AG8 -to adc_cnv ; ## Arduino_IO06 set_location_assignment PIN_AE15 -to adc_gp0 ; ## Arduino_IO09 set_location_assignment PIN_AF17 -to adc_gp1 ; ## Arduino_IO08 + +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to i2c_scl +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to i2c_sda + set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to adc_spi_sclk set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to adc_spi_sdi set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to adc_spi_sdo diff --git a/projects/ad4052_ardz/de10nano/system_top.v b/projects/ad4052_ardz/de10nano/system_top.v index cbbd7297285..b1e71829d2c 100644 --- a/projects/ad4052_ardz/de10nano/system_top.v +++ b/projects/ad4052_ardz/de10nano/system_top.v @@ -114,6 +114,9 @@ module system_top ( inout hdmi_i2c_scl, inout hdmi_i2c_sda, + inout i2c_sda, + inout i2c_scl, + // ad4052 output adc_spi_sclk, @@ -157,6 +160,18 @@ module system_top ( // IO Buffers for I2C + ALT_IOBUF scl_iobuf ( + .i(1'b0), + .oe(i2c1_scl_oe), + .o(i2c1_scl), + .io(i2c_scl)); + + ALT_IOBUF sda_iobuf ( + .i(1'b0), + .oe(i2c1_sda_oe), + .o(i2c1_sda), + .io(i2c_sda)); + ALT_IOBUF scl_video_iobuf ( .i(1'b0), .oe(i2c0_out_clk),