initial commit, add dds_par module

This commit is contained in:
2024-01-15 09:36:08 +08:00
commit 315a673005
1374 changed files with 465956 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
####################################################################################
## Copyright (c) 2018 - 2023 Analog Devices, Inc.
### SPDX short identifier: BSD-1-Clause
## Auto-generated, do not modify!
####################################################################################
LIBRARY_NAME := axi_ad7606x
GENERIC_DEPS += ../common/ad_datafmt.v
GENERIC_DEPS += ../common/ad_edge_detect.v
GENERIC_DEPS += ../common/ad_rst.v
GENERIC_DEPS += ../common/up_adc_channel.v
GENERIC_DEPS += ../common/up_adc_common.v
GENERIC_DEPS += ../common/up_axi.v
GENERIC_DEPS += ../common/up_clock_mon.v
GENERIC_DEPS += ../common/up_delay_cntrl.v
GENERIC_DEPS += ../common/up_xfer_cntrl.v
GENERIC_DEPS += ../common/up_xfer_status.v
GENERIC_DEPS += axi_ad7606x.v
GENERIC_DEPS += axi_ad7606x_16b_pif.v
GENERIC_DEPS += axi_ad7606x_18b_pif.v
XILINX_DEPS += ../xilinx/common/ad_dcfilter.v
XILINX_DEPS += ../xilinx/common/ad_rst_constr.xdc
XILINX_DEPS += ../xilinx/common/up_clock_mon_constr.xdc
XILINX_DEPS += ../xilinx/common/up_xfer_cntrl_constr.xdc
XILINX_DEPS += ../xilinx/common/up_xfer_status_constr.xdc
XILINX_DEPS += axi_ad7606x_ip.tcl
include ../scripts/library.mk
+488
View File
@@ -0,0 +1,488 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2023 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/master/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
module axi_ad7606x #(
parameter ID = 0,
parameter DEV_CONFIG = 0,
parameter ADC_CH_DW = 16,
parameter ADC_N_BITS = 16,
parameter EXTERNAL_CLK = 0
) (
// physical data interface
output rx_cs_n,
output [15:0] rx_db_o,
input [15:0] rx_db_i,
output rx_db_t,
output rx_rd_n,
output rx_wr_n,
input external_clk,
// physical control interface
input rx_busy,
input first_data,
// AXI Slave Memory Map
input s_axi_aclk,
input s_axi_aresetn,
input s_axi_awvalid,
input [15:0] s_axi_awaddr,
input [ 2:0] s_axi_awprot,
output s_axi_awready,
input s_axi_wvalid,
input [31:0] s_axi_wdata,
input [ 3:0] s_axi_wstrb,
output s_axi_wready,
output s_axi_bvalid,
output [ 1:0] s_axi_bresp,
input s_axi_bready,
input s_axi_arvalid,
input [15:0] s_axi_araddr,
input [ 2:0] s_axi_arprot,
output s_axi_arready,
output s_axi_rvalid,
output [ 1:0] s_axi_rresp,
output [31:0] s_axi_rdata,
input s_axi_rready,
input adc_dovf,
output adc_clk,
output adc_valid,
output [ADC_CH_DW-1:0] adc_data_0,
output [ADC_CH_DW-1:0] adc_data_1,
output [ADC_CH_DW-1:0] adc_data_2,
output [ADC_CH_DW-1:0] adc_data_3,
output [ADC_CH_DW-1:0] adc_data_4,
output [ADC_CH_DW-1:0] adc_data_5,
output [ADC_CH_DW-1:0] adc_data_6,
output [ADC_CH_DW-1:0] adc_data_7,
output adc_enable_0,
output adc_enable_1,
output adc_enable_2,
output adc_enable_3,
output adc_enable_4,
output adc_enable_5,
output adc_enable_6,
output adc_enable_7,
output adc_reset
);
localparam [31:0] RD_RAW_CAP = 32'h2000;
localparam AD7606B = 1'b0;
localparam AD7606C_16 = 1'b1;
// internal registers
reg up_wack = 1'b0;
reg up_rack = 1'b0;
reg [31:0] up_rdata = 32'b0;
reg [31:0] up_rdata_r;
reg up_rack_r;
reg up_wack_r;
// internal signals
wire [ADC_N_BITS-1:0] adc_data_0_s;
wire [ADC_N_BITS-1:0] adc_data_1_s;
wire [ADC_N_BITS-1:0] adc_data_2_s;
wire [ADC_N_BITS-1:0] adc_data_3_s;
wire [ADC_N_BITS-1:0] adc_data_4_s;
wire [ADC_N_BITS-1:0] adc_data_5_s;
wire [ADC_N_BITS-1:0] adc_data_6_s;
wire [ADC_N_BITS-1:0] adc_data_7_s;
wire [(8*ADC_N_BITS)-1:0] adc_data_s;
wire [ 7:0] adc_status_header[0:7];
wire adc_status;
wire [15:0] adc_crc;
wire [15:0] adc_crc_res;
wire adc_crc_err;
wire adc_mode_en;
wire [ 7:0] adc_custom_control;
wire adc_dfmt_enable_s[0:7];
wire adc_dfmt_type_s[0:7];
wire adc_dfmt_se_s[0:7];
wire adc_clk_s;
wire [ 7:0] adc_enable;
wire adc_reset_s;
wire [(8*ADC_CH_DW)-1:0] dma_data;
wire dma_dvalid;
wire up_clk;
wire up_rstn;
wire up_rreq_s;
wire [13:0] up_raddr_s;
wire up_wreq_s;
wire [13:0] up_waddr_s;
wire [31:0] up_wdata_s;
wire [31:0] up_rdata_s[0:8];
wire [8:0] up_rack_s;
wire [8:0] up_wack_s;
wire up_wack_cntrl_s;
wire up_rack_cntrl_s;
wire [31:0] up_rdata_cntrl_s;
wire [31:0] wr_data_s;
wire [15:0] rd_data_s;
wire rd_valid_s;
wire [31:0] adc_config_ctrl_s;
wire adc_ctrl_status_s;
wire m_axis_ready_s;
wire m_axis_valid_s;
wire [15:0] m_axis_data_s;
wire m_axis_xfer_req_s;
// defaults
assign up_clk = s_axi_aclk;
assign up_rstn = s_axi_aresetn;
assign adc_reset = adc_reset_s;
assign adc_enable_0 = adc_enable[0];
assign adc_enable_1 = adc_enable[1];
assign adc_enable_2 = adc_enable[2];
assign adc_enable_3 = adc_enable[3];
assign adc_enable_4 = adc_enable[4];
assign adc_enable_5 = adc_enable[5];
assign adc_enable_6 = adc_enable[6];
assign adc_enable_7 = adc_enable[7];
// processor read interface
integer j;
always @(*) begin
up_rdata_r = 'h00;
up_rack_r = 'h00;
up_wack_r = 'h00;
for (j = 0; j <= 8; j=j+1) begin
up_rack_r = up_rack_r | up_rack_s[j];
up_wack_r = up_wack_r | up_wack_s[j];
up_rdata_r = up_rdata_r | up_rdata_s[j];
end
end
always @(negedge up_rstn or posedge up_clk) begin
if (up_rstn == 0) begin
up_rdata <= 'd0;
up_rack <= 'd0;
up_wack <= 'd0;
end else begin
up_rdata <= up_rdata_r;
up_rack <= up_rack_r;
up_wack <= up_wack_r;
end
end
generate
if (EXTERNAL_CLK == 1'b1) begin
assign adc_clk_s = external_clk;
end else begin
assign adc_clk_s = up_clk;
end
endgenerate
assign adc_clk = adc_clk_s;
generate
genvar i;
for (i = 0; i < 8; i = i + 1) begin
up_adc_channel #(
.CHANNEL_ID(i)
) i_up_adc_channel (
.adc_clk (adc_clk_s),
.adc_rst (adc_reset_s),
.adc_enable (adc_enable[i]),
.adc_iqcor_enb (),
.adc_dcfilt_enb (),
.adc_dfmt_se (adc_dfmt_se_s[i]),
.adc_dfmt_type (adc_dfmt_type_s[i]),
.adc_dfmt_enable (adc_dfmt_enable_s[i]),
.adc_dcfilt_offset (),
.adc_dcfilt_coeff (),
.adc_iqcor_coeff_1 (),
.adc_iqcor_coeff_2 (),
.adc_pnseq_sel (),
.adc_data_sel (),
.adc_pn_err (1'b0),
.adc_pn_oos (1'b0),
.adc_or (1'b0),
.adc_read_data (rd_data_s),
.adc_status_header(adc_status_header[i]),
.adc_crc_err(adc_crc_err),
.up_adc_pn_err (),
.up_adc_pn_oos (),
.up_adc_or (),
.up_usr_datatype_be (),
.up_usr_datatype_signed (),
.up_usr_datatype_shift (),
.up_usr_datatype_total_bits (),
.up_usr_datatype_bits (),
.up_usr_decimation_m (),
.up_usr_decimation_n (),
.adc_usr_datatype_be (1'b0),
.adc_usr_datatype_signed (1'b1),
.adc_usr_datatype_shift (8'd0),
.adc_usr_datatype_total_bits (8'd16),
.adc_usr_datatype_bits (8'd16),
.adc_usr_decimation_m (16'd1),
.adc_usr_decimation_n (16'd1),
.up_rstn (up_rstn),
.up_clk (up_clk),
.up_wreq (up_wreq_s),
.up_waddr (up_waddr_s),
.up_wdata (up_wdata_s),
.up_wack (up_wack_s[i]),
.up_rreq (up_rreq_s),
.up_raddr (up_raddr_s),
.up_rdata (up_rdata_s[i]),
.up_rack (up_rack_s[i]));
end
endgenerate
genvar k;
generate
for (k = 0;k < 8;k = k + 1) begin
ad_datafmt #(
.DATA_WIDTH (ADC_N_BITS),
.BITS_PER_SAMPLE (ADC_CH_DW)
) i_datafmt (
.clk (adc_clk),
.valid (1'b1),
.data (adc_data_s[k*ADC_N_BITS+(ADC_N_BITS-1):k*ADC_N_BITS]),
.valid_out (dma_dvalid),
.data_out (dma_data[k*ADC_CH_DW+(ADC_CH_DW-1):k*ADC_CH_DW]),
.dfmt_enable (adc_dfmt_enable_s[k]),
.dfmt_type (adc_dfmt_type_s[k]),
.dfmt_se (adc_dfmt_se_s[k]));
end
endgenerate
generate
if (DEV_CONFIG == AD7606B || DEV_CONFIG == AD7606C_16) begin
axi_ad7606x_16b_pif i_ad7606_parallel_interface (
.cs_n (rx_cs_n),
.db_o (rx_db_o),
.db_i (rx_db_i),
.db_t (rx_db_t),
.rd_n (rx_rd_n),
.wr_n (rx_wr_n),
.busy (rx_busy),
.first_data (first_data),
.adc_data_0 (adc_data_0_s),
.adc_status_0 (adc_status_header[0]),
.adc_data_1 (adc_data_1_s),
.adc_status_1 (adc_status_header[1]),
.adc_data_2 (adc_data_2_s),
.adc_status_2 (adc_status_header[2]),
.adc_data_3 (adc_data_3_s),
.adc_status_3 (adc_status_header[3]),
.adc_data_4 (adc_data_4_s),
.adc_status_4 (adc_status_header[4]),
.adc_data_5 (adc_data_5_s),
.adc_status_5 (adc_status_header[5]),
.adc_data_6 (adc_data_6_s),
.adc_status_6 (adc_status_header[6]),
.adc_data_7 (adc_data_7_s),
.adc_status_7 (adc_status_header[7]),
.adc_status (adc_status),
.adc_crc (adc_crc),
.adc_crc_res (adc_crc_res),
.adc_crc_err (adc_crc_err),
.adc_valid (adc_valid),
.clk (adc_clk_s),
.rstn (up_rstn),
.adc_config_ctrl (adc_config_ctrl_s),
.adc_ctrl_status (adc_ctrl_status_s),
.adc_mode_en (adc_mode_en),
.adc_custom_control (adc_custom_control),
.wr_data (wr_data_s[15:0]),
.rd_data (rd_data_s),
.rd_valid (rd_valid_s));
end else begin
axi_ad7606x_18b_pif i_ad7606_parallel_interface (
.cs_n (rx_cs_n),
.db_o (rx_db_o),
.db_i (rx_db_i),
.db_t (rx_db_t),
.rd_n (rx_rd_n),
.wr_n (rx_wr_n),
.busy (rx_busy),
.first_data (first_data),
.adc_data_0 (adc_data_0_s),
.adc_status_0 (adc_status_header[0]),
.adc_data_1 (adc_data_1_s),
.adc_status_1 (adc_status_header[1]),
.adc_data_2 (adc_data_2_s),
.adc_status_2 (adc_status_header[2]),
.adc_data_3 (adc_data_3_s),
.adc_status_3 (adc_status_header[3]),
.adc_data_4 (adc_data_4_s),
.adc_status_4 (adc_status_header[4]),
.adc_data_5 (adc_data_5_s),
.adc_status_5 (adc_status_header[5]),
.adc_data_6 (adc_data_6_s),
.adc_status_6 (adc_status_header[6]),
.adc_data_7 (adc_data_7_s),
.adc_status_7 (adc_status_header[7]),
.adc_status (adc_status),
.adc_crc (adc_crc),
.adc_crc_res (adc_crc_res),
.adc_crc_err (adc_crc_err),
.adc_valid (adc_valid),
.clk (adc_clk_s),
.rstn (up_rstn),
.adc_config_ctrl (adc_config_ctrl_s),
.adc_ctrl_status (adc_ctrl_status_s),
.adc_mode_en (adc_mode_en),
.adc_custom_control (adc_custom_control),
.wr_data (wr_data_s[15:0]),
.rd_data (rd_data_s),
.rd_valid (rd_valid_s));
end
endgenerate
assign adc_data_s = {adc_data_0_s,adc_data_1_s,adc_data_2_s,adc_data_3_s,adc_data_4_s,adc_data_5_s,adc_data_6_s,adc_data_7_s};
assign adc_data_7 = dma_data[0*ADC_CH_DW+(ADC_CH_DW-1):0*ADC_CH_DW];
assign adc_data_6 = dma_data[1*ADC_CH_DW+(ADC_CH_DW-1):1*ADC_CH_DW];
assign adc_data_5 = dma_data[2*ADC_CH_DW+(ADC_CH_DW-1):2*ADC_CH_DW];
assign adc_data_4 = dma_data[3*ADC_CH_DW+(ADC_CH_DW-1):3*ADC_CH_DW];
assign adc_data_3 = dma_data[4*ADC_CH_DW+(ADC_CH_DW-1):4*ADC_CH_DW];
assign adc_data_2 = dma_data[5*ADC_CH_DW+(ADC_CH_DW-1):5*ADC_CH_DW];
assign adc_data_1 = dma_data[6*ADC_CH_DW+(ADC_CH_DW-1):6*ADC_CH_DW];
assign adc_data_0 = dma_data[7*ADC_CH_DW+(ADC_CH_DW-1):7*ADC_CH_DW];
up_adc_common #(
.ID (ID),
.CONFIG (RD_RAW_CAP)
) i_up_adc_common (
.mmcm_rst (),
.adc_clk (adc_clk_s),
.adc_rst (adc_reset_s),
.adc_r1_mode (),
.adc_ddr_edgesel (),
.adc_pin_mode (),
.adc_status (adc_status),
.adc_sync_status (1'b1),
.adc_status_ovf (adc_dovf),
.adc_clk_ratio (),
.adc_start_code (),
.adc_sref_sync (),
.adc_sync (),
.adc_ext_sync_arm (),
.adc_ext_sync_disarm (),
.adc_ext_sync_manual_req (),
.adc_num_lanes (),
.adc_custom_control (adc_custom_control),
.adc_crc_enable (adc_mode_en),
.adc_sdr_ddr_n (),
.adc_symb_op (),
.adc_symb_8_16b (),
.up_pps_rcounter (),
.up_pps_status (),
.up_pps_irq_mask (),
.up_adc_r1_mode (),
.up_status_pn_err (),
.up_status_pn_oos (),
.up_status_or (),
.up_drp_sel (),
.up_drp_wr (),
.up_drp_addr (),
.up_drp_wdata (),
.up_drp_rdata (),
.up_drp_ready (),
.up_drp_locked (),
.adc_config_wr (wr_data_s),
.adc_config_ctrl (adc_config_ctrl_s),
.adc_config_rd ({16'd0, rd_data_s}),
.adc_ctrl_status (adc_ctrl_status_s),
.up_adc_gpio_in (),
.up_adc_gpio_out (),
.up_adc_ce (),
.up_rstn (up_rstn),
.up_clk (up_clk),
.up_wreq (up_wreq_s),
.up_waddr (up_waddr_s),
.up_wdata (up_wdata_s),
.up_wack (up_wack_s[8]),
.up_rreq (up_rreq_s),
.up_raddr (up_raddr_s),
.up_rdata (up_rdata_s[8]),
.up_rack (up_rack_s[8]));
// up bus interface
up_axi #(
.AXI_ADDRESS_WIDTH (16)
) i_up_axi (
.up_rstn (up_rstn),
.up_clk (up_clk),
.up_axi_awvalid (s_axi_awvalid),
.up_axi_awaddr (s_axi_awaddr),
.up_axi_awready (s_axi_awready),
.up_axi_wvalid (s_axi_wvalid),
.up_axi_wdata (s_axi_wdata),
.up_axi_wstrb (s_axi_wstrb),
.up_axi_wready (s_axi_wready),
.up_axi_bvalid (s_axi_bvalid),
.up_axi_bresp (s_axi_bresp),
.up_axi_bready (s_axi_bready),
.up_axi_arvalid (s_axi_arvalid),
.up_axi_araddr (s_axi_araddr),
.up_axi_arready (s_axi_arready),
.up_axi_rvalid (s_axi_rvalid),
.up_axi_rresp (s_axi_rresp),
.up_axi_rdata (s_axi_rdata),
.up_axi_rready (s_axi_rready),
.up_wreq (up_wreq_s),
.up_waddr (up_waddr_s),
.up_wdata (up_wdata_s),
.up_wack (up_wack),
.up_rreq (up_rreq_s),
.up_raddr (up_raddr_s),
.up_rdata (up_rdata),
.up_rack (up_rack));
endmodule
+516
View File
@@ -0,0 +1,516 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Product Version: Vivado v2023.2.1 (64-bit) -->
<!-- -->
<!-- Copyright 1986-2022 Xilinx, Inc. All Rights Reserved. -->
<!-- Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. -->
<Project Product="Vivado" Version="7" Minor="65" Path="/home/josh/tmp/hdl/library/axi_ad7606x/axi_ad7606x.xpr">
<DefaultLaunch Dir="$PRUNDIR"/>
<Configuration>
<Option Name="Id" Val="f98c19d8f31b4047a3ade4396f117f50"/>
<Option Name="Part" Val="xc7vx485tffg1157-1"/>
<Option Name="CompiledLibDir" Val="$PCACHEDIR/compile_simlib"/>
<Option Name="CompiledLibDirXSim" Val=""/>
<Option Name="CompiledLibDirModelSim" Val="$PCACHEDIR/compile_simlib/modelsim"/>
<Option Name="CompiledLibDirQuesta" Val="$PCACHEDIR/compile_simlib/questa"/>
<Option Name="CompiledLibDirXcelium" Val="$PCACHEDIR/compile_simlib/xcelium"/>
<Option Name="CompiledLibDirVCS" Val="$PCACHEDIR/compile_simlib/vcs"/>
<Option Name="CompiledLibDirRiviera" Val="$PCACHEDIR/compile_simlib/riviera"/>
<Option Name="CompiledLibDirActivehdl" Val="$PCACHEDIR/compile_simlib/activehdl"/>
<Option Name="SimulatorInstallDirModelSim" Val=""/>
<Option Name="SimulatorInstallDirQuesta" Val=""/>
<Option Name="SimulatorInstallDirXcelium" Val=""/>
<Option Name="SimulatorInstallDirVCS" Val=""/>
<Option Name="SimulatorInstallDirRiviera" Val=""/>
<Option Name="SimulatorInstallDirActiveHdl" Val=""/>
<Option Name="SimulatorGccInstallDirModelSim" Val=""/>
<Option Name="SimulatorGccInstallDirQuesta" Val=""/>
<Option Name="SimulatorGccInstallDirXcelium" Val=""/>
<Option Name="SimulatorGccInstallDirVCS" Val=""/>
<Option Name="SimulatorGccInstallDirRiviera" Val=""/>
<Option Name="SimulatorGccInstallDirActiveHdl" Val=""/>
<Option Name="SimulatorVersionXsim" Val="2023.2"/>
<Option Name="SimulatorVersionModelSim" Val="2023.2"/>
<Option Name="SimulatorVersionQuesta" Val="2023.2"/>
<Option Name="SimulatorVersionXcelium" Val="23.03.002"/>
<Option Name="SimulatorVersionVCS" Val="U-2023.03-1"/>
<Option Name="SimulatorVersionRiviera" Val="2022.10"/>
<Option Name="SimulatorVersionActiveHdl" Val="14.1"/>
<Option Name="SimulatorGccVersionXsim" Val="9.3.0"/>
<Option Name="SimulatorGccVersionModelSim" Val="7.4.0"/>
<Option Name="SimulatorGccVersionQuesta" Val="7.4.0"/>
<Option Name="SimulatorGccVersionXcelium" Val="9.3.0"/>
<Option Name="SimulatorGccVersionVCS" Val="9.2.0"/>
<Option Name="SimulatorGccVersionRiviera" Val="9.3.0"/>
<Option Name="SimulatorGccVersionActiveHdl" Val="9.3.0"/>
<Option Name="BoardPart" Val=""/>
<Option Name="ActiveSimSet" Val="sim_1"/>
<Option Name="DefaultLib" Val="xil_defaultlib"/>
<Option Name="ProjectType" Val="Default"/>
<Option Name="IPRepoPath" Val="$PPRDIR/../../library"/>
<Option Name="IPOutputRepo" Val="$PCACHEDIR/ip"/>
<Option Name="IPDefaultOutputPath" Val="$PGENDIR/sources_1"/>
<Option Name="IPCachePermission" Val="read"/>
<Option Name="IPCachePermission" Val="write"/>
<Option Name="EnableCoreContainer" Val="FALSE"/>
<Option Name="EnableResourceEstimation" Val="FALSE"/>
<Option Name="SimCompileState" Val="TRUE"/>
<Option Name="CreateRefXciForCoreContainers" Val="FALSE"/>
<Option Name="IPUserFilesDir" Val="$PIPUSERFILESDIR"/>
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
<Option Name="EnableBDX" Val="FALSE"/>
<Option Name="FeatureSet" Val="FeatureSet_Classic"/>
<Option Name="WTXSimLaunchSim" Val="0"/>
<Option Name="WTModelSimLaunchSim" Val="0"/>
<Option Name="WTQuestaLaunchSim" Val="0"/>
<Option Name="WTIesLaunchSim" Val="0"/>
<Option Name="WTVcsLaunchSim" Val="0"/>
<Option Name="WTRivieraLaunchSim" Val="0"/>
<Option Name="WTActivehdlLaunchSim" Val="0"/>
<Option Name="WTXSimExportSim" Val="0"/>
<Option Name="WTModelSimExportSim" Val="0"/>
<Option Name="WTQuestaExportSim" Val="0"/>
<Option Name="WTIesExportSim" Val="0"/>
<Option Name="WTVcsExportSim" Val="0"/>
<Option Name="WTRivieraExportSim" Val="0"/>
<Option Name="WTActivehdlExportSim" Val="0"/>
<Option Name="GenerateIPUpgradeLog" Val="TRUE"/>
<Option Name="XSimRadix" Val="hex"/>
<Option Name="XSimTimeUnit" Val="ns"/>
<Option Name="XSimArrayDisplayLimit" Val="1024"/>
<Option Name="XSimTraceLimit" Val="65536"/>
<Option Name="SimTypes" Val="rtl"/>
<Option Name="SimTypes" Val="bfm"/>
<Option Name="SimTypes" Val="tlm"/>
<Option Name="SimTypes" Val="tlm_dpi"/>
<Option Name="MEMEnableMemoryMapGeneration" Val="TRUE"/>
<Option Name="DcpsUptoDate" Val="TRUE"/>
<Option Name="ClassicSocBoot" Val="FALSE"/>
<Option Name="LocalIPRepoLeafDirName" Val="ip_repo"/>
</Configuration>
<FileSets Version="1" Minor="32">
<FileSet Name="sources_1" Type="DesignSrcs" RelSrcDir="$PSRCDIR/sources_1" RelGenDir="$PGENDIR/sources_1">
<Filter Type="Srcs"/>
<File Path="$PPRDIR/../common/ad_datafmt.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/ad_edge_detect.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/ad_rst.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/axi_ad7606x_16b_pif.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/axi_ad7606x_18b_pif.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_adc_channel.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_adc_common.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_axi.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_clock_mon.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_xfer_cntrl.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_xfer_status.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/axi_ad7606x.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../xilinx/common/ad_dcfilter.v">
<FileInfo>
<Attr Name="AutoDisabled" Val="1"/>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../common/up_delay_cntrl.v">
<FileInfo>
<Attr Name="AutoDisabled" Val="1"/>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/component.xml">
<FileInfo SFType="IPXACT"/>
</File>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="axi_ad7606x"/>
</Config>
</FileSet>
<FileSet Name="constrs_1" Type="Constrs" RelSrcDir="$PSRCDIR/constrs_1" RelGenDir="$PGENDIR/constrs_1">
<Filter Type="Constrs"/>
<File Path="$PPRDIR/../xilinx/common/ad_rst_constr.xdc">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../xilinx/common/up_xfer_cntrl_constr.xdc">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../xilinx/common/up_xfer_status_constr.xdc">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../xilinx/common/up_clock_mon_constr.xdc">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
</FileInfo>
</File>
<Config>
<Option Name="ConstrsType" Val="XDC"/>
</Config>
</FileSet>
<FileSet Name="sim_1" Type="SimulationSrcs" RelSrcDir="$PSRCDIR/sim_1" RelGenDir="$PGENDIR/sim_1">
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopAutoSet" Val="TRUE"/>
<Option Name="TransportPathDelay" Val="0"/>
<Option Name="TransportIntDelay" Val="0"/>
<Option Name="SelectedSimModel" Val="rtl"/>
<Option Name="PamDesignTestbench" Val=""/>
<Option Name="PamDutBypassFile" Val="xil_dut_bypass"/>
<Option Name="PamSignalDriverFile" Val="xil_bypass_driver"/>
<Option Name="PamPseudoTop" Val="pseudo_tb"/>
<Option Name="SrcSet" Val="sources_1"/>
</Config>
</FileSet>
<FileSet Name="utils_1" Type="Utils" RelSrcDir="$PSRCDIR/utils_1" RelGenDir="$PGENDIR/utils_1">
<Filter Type="Utils"/>
<Config>
<Option Name="TopAutoSet" Val="TRUE"/>
</Config>
</FileSet>
</FileSets>
<Simulators>
<Simulator Name="XSim">
<Option Name="Description" Val="Vivado Simulator"/>
<Option Name="CompiledLib" Val="0"/>
</Simulator>
<Simulator Name="ModelSim">
<Option Name="Description" Val="ModelSim Simulator"/>
</Simulator>
<Simulator Name="Questa">
<Option Name="Description" Val="Questa Advanced Simulator"/>
</Simulator>
<Simulator Name="Xcelium">
<Option Name="Description" Val="Xcelium Parallel Simulator"/>
</Simulator>
<Simulator Name="VCS">
<Option Name="Description" Val="Verilog Compiler Simulator (VCS)"/>
</Simulator>
<Simulator Name="Riviera">
<Option Name="Description" Val="Riviera-PRO Simulator"/>
</Simulator>
</Simulators>
<Runs Version="1" Minor="21">
<Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7vx485tffg1157-1" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" AutoIncrementalCheckpoint="true" WriteIncrSynthDcp="false" State="current" IncludeInArchive="true" IsChild="false" AutoIncrementalDir="$PSRCDIR/utils_1/imports/synth_1" AutoRQSDir="$PSRCDIR/utils_1/imports/synth_1">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2023">
<Desc>Vivado Synthesis Defaults</Desc>
</StratHandle>
<Step Id="synth_design"/>
</Strategy>
<ReportStrategy Name="Vivado Synthesis Default Reports" Flow="Vivado Synthesis 2023"/>
<Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
<RQSFiles/>
</Run>
<Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7vx485tffg1157-1" ConstrsSet="constrs_1" Description="Default settings for Implementation." AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" SynthRun="synth_1" IncludeInArchive="true" IsChild="false" GenFullBitstream="true" AutoIncrementalDir="$PSRCDIR/utils_1/imports/impl_1" AutoRQSDir="$PSRCDIR/utils_1/imports/impl_1">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2023">
<Desc>Default settings for Implementation.</Desc>
</StratHandle>
<Step Id="init_design"/>
<Step Id="opt_design"/>
<Step Id="power_opt_design"/>
<Step Id="place_design"/>
<Step Id="post_place_power_opt_design"/>
<Step Id="phys_opt_design"/>
<Step Id="route_design"/>
<Step Id="post_route_phys_opt_design"/>
<Step Id="write_bitstream"/>
</Strategy>
<ReportStrategy Name="Vivado Implementation Default Reports" Flow="Vivado Implementation 2023"/>
<Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
<RQSFiles/>
</Run>
</Runs>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Vivado 12-1790"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="1"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="Evaluation"/>
<MsgAttr Name="StringsToMatch" Val="features"/>
<MsgAttr Name="StringsToMatch" Val="should"/>
<MsgAttr Name="StringsToMatch" Val="NOT"/>
<MsgAttr Name="StringsToMatch" Val="be"/>
<MsgAttr Name="StringsToMatch" Val="used"/>
<MsgAttr Name="StringsToMatch" Val="in"/>
<MsgAttr Name="StringsToMatch" Val="production"/>
<MsgAttr Name="StringsToMatch" Val="systems."/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="Designutils 20-3303"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="10"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="HDPYFinalizeIO"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Place 30-73"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="11"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="axi_spi"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val=""/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="12"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="BD 41-1343"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="2"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="BD 41-1306"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="3"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="ERROR"/>
<MsgAttr Name="Id" Val="BD 41-1276"/>
<MsgAttr Name="Severity" Val="CRITICAL WARNING"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="4"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-3656"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="5"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-4623"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="6"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-459"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="7"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="Synth 8-3331"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="8"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Synth 8-2490"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="9"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<Board/>
<DashboardSummary Version="1" Minor="0">
<Dashboards>
<Dashboard Name="default_dashboard">
<Gadgets>
<Gadget Name="drc_1" Type="drc" Version="1" Row="2" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_drc_0 "/>
</Gadget>
<Gadget Name="methodology_1" Type="methodology" Version="1" Row="2" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_methodology_0 "/>
</Gadget>
<Gadget Name="power_1" Type="power" Version="1" Row="1" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_power_0 "/>
</Gadget>
<Gadget Name="timing_1" Type="timing" Version="1" Row="0" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_timing_summary_0 "/>
</Gadget>
<Gadget Name="utilization_1" Type="utilization" Version="1" Row="0" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="synth_1#synth_1_synth_report_utilization_0 "/>
<GadgetParam Name="RUN.STEP" Type="string" Value="synth_design"/>
<GadgetParam Name="RUN.TYPE" Type="string" Value="synthesis"/>
</Gadget>
<Gadget Name="utilization_2" Type="utilization" Version="1" Row="1" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_place_report_utilization_0 "/>
</Gadget>
</Gadgets>
</Dashboard>
<CurrentDashboard>default_dashboard</CurrentDashboard>
</Dashboards>
</DashboardSummary>
</Project>
@@ -0,0 +1,475 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2023 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/master/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
module axi_ad7606x_16b_pif #(
parameter NEG_EDGE = 1,
parameter POS_EDGE = 0
) (
// physical interface
output cs_n,
output [15:0] db_o,
input [15:0] db_i,
output db_t,
output rd_n,
output wr_n,
input busy,
input first_data,
// FIFO interface
output reg [15:0] adc_data_0,
output reg [ 7:0] adc_status_0 = 'h0,
output reg [15:0] adc_data_1,
output reg [ 7:0] adc_status_1 = 'h0,
output reg [15:0] adc_data_2,
output reg [ 7:0] adc_status_2 = 'h0,
output reg [15:0] adc_data_3,
output reg [ 7:0] adc_status_3 = 'h0,
output reg [15:0] adc_data_4,
output reg [ 7:0] adc_status_4 = 'h0,
output reg [15:0] adc_data_5,
output reg [ 7:0] adc_status_5 = 'h0,
output reg [15:0] adc_data_6,
output reg [ 7:0] adc_status_6 = 'h0,
output reg [15:0] adc_data_7,
output reg [ 7:0] adc_status_7 = 'h0,
output adc_status,
output [15:0] adc_crc,
output [15:0] adc_crc_res,
output adc_crc_err,
output reg adc_valid,
// register access
input clk,
input rstn,
input [31:0] adc_config_ctrl,
output adc_ctrl_status,
input [15:0] wr_data,
input adc_mode_en,
input [7:0] adc_custom_control,
output reg [15:0] rd_data = 'hf,
output reg rd_valid
);
// state registers
localparam [ 2:0] IDLE = 3'h0;
localparam [ 2:0] CS_LOW = 3'h1;
localparam [ 2:0] CNTRL_LOW = 3'h2;
localparam [ 2:0] CNTRL_HIGH = 3'h3;
localparam [ 2:0] CS_HIGH = 3'h4;
localparam [ 1:0] SIMPLE = 0;
localparam [ 1:0] STATUS_HEADER = 2;
localparam [ 1:0] CRC_ENABLED = 1;
localparam [ 1:0] CRC_STATUS = 3;
// internal registers
reg [ 2:0] transfer_state = 3'h0;
reg [ 2:0] transfer_state_next = 3'h0;
reg [ 3:0] width_counter = 4'h0;
reg [ 4:0] channel_counter = 5'h0;
reg [ 4:0] nr_rd_burst = 5'h0;
reg rd_conv_d = 1'h0;
reg adc_config_enable_d = 1'h0;
reg rd_valid_d = 1'h0;
reg read_ch_data = 1'd0;
reg [ 7:0] adc_status_er_ch_id = 8'h0;
reg [15:0] adc_crc_r = 16'h0;
reg [15:0] adc_crc_res_r = 16'h0;
reg [ 1:0] adc_config_mode_r = 2'h0;
// internal wires
wire rd_req_s;
wire wr_req_s;
wire end_of_conv;
wire start_transfer_s;
wire rd_valid_s;
wire rd_new_data_s;
wire adc_config_enable;
wire adc_config_en;
wire adc_config_rd_wr;
wire [ 1:0] adc_config_mode;
wire [ 4:0] adc_status_er_5b;
wire adc_status_er;
// adc_config_rd_wr - RD (1), WR (0)
assign adc_config_enable = adc_config_ctrl[0];
assign adc_config_rd_wr = adc_config_ctrl[1];
// instantiations
ad_edge_detect #(
.EDGE(POS_EDGE)
) i_ad_edge_detect_en (
.clk (clk),
.rst (~rstn),
.signal_in (adc_config_enable),
.signal_out (adc_config_en));
ad_edge_detect #(
.EDGE(NEG_EDGE)
) i_ad_edge_detect (
.clk (clk),
.rst (~rstn),
.signal_in (busy),
.signal_out (end_of_conv));
// counters to control the RD_N and WR_N lines
assign start_transfer_s = (end_of_conv | adc_config_en) ? 1'b1 : 1'b0;
always @(posedge clk) begin
if (rstn == 1'b0) begin
adc_config_mode_r <= 2'h0;
end else begin
if (adc_mode_en) begin
if (adc_custom_control == 'h0) begin
adc_config_mode_r <= SIMPLE;
end else if (adc_custom_control == 'h1) begin
adc_config_mode_r <= CRC_ENABLED;
end else if (adc_custom_control == 'h2) begin
adc_config_mode_r <= STATUS_HEADER;
end else if (adc_custom_control == 'h3) begin
adc_config_mode_r <= CRC_STATUS;
end else begin
adc_config_mode_r <= adc_config_mode;
end
end else begin
adc_config_mode_r <= adc_config_mode;
end
end
end
assign adc_config_mode = adc_config_mode_r;
always @(negedge clk) begin
if (transfer_state == IDLE) begin
rd_conv_d <= end_of_conv;
adc_config_enable_d <= adc_config_en;
end
end
always @(posedge clk) begin
if (rstn == 1'b0) begin
width_counter <= 4'h0;
end else begin
if(transfer_state == CNTRL_LOW || transfer_state == CNTRL_HIGH) begin
width_counter <= width_counter + 1;
end else begin
width_counter <= 4'h0;
end
end
end
always @(posedge clk) begin
if (rstn == 1'b0) begin
channel_counter <= 5'h0;
end else begin
if (rd_new_data_s == 1'b1 && read_ch_data == 1'b1) begin
channel_counter <= channel_counter + 1;
end else if (transfer_state == IDLE) begin
channel_counter <= 5'h0;
end
end
end
always @(posedge clk) begin
if (adc_config_mode == SIMPLE) begin
nr_rd_burst = 5'd8;
if ((first_data & ~cs_n) && ~adc_config_enable_d) begin
read_ch_data <= 1'b1;
end else if (channel_counter == 5'd8 && transfer_state == IDLE) begin
read_ch_data <= 1'b0;
end
end else if (adc_config_mode == CRC_ENABLED) begin
nr_rd_burst = 5'd9;
if ((first_data & ~cs_n) && ~adc_config_enable_d) begin
read_ch_data <= 1'b1;
end else if (channel_counter == 5'd9 && transfer_state == IDLE) begin
read_ch_data <= 1'b0;
end
end else if (adc_config_mode == STATUS_HEADER) begin
nr_rd_burst <= 5'd16;
if ((first_data & ~cs_n) && ~adc_config_enable_d) begin
read_ch_data <= 1'b1;
end else if (channel_counter == 5'd16 && transfer_state == IDLE) begin
read_ch_data <= 1'b0;
end
end else if (adc_config_mode == CRC_STATUS) begin
nr_rd_burst <= 5'd17;
if ((first_data & ~cs_n) && ~adc_config_enable_d) begin
read_ch_data <= 1'b0;
end else if (channel_counter == 5'd17 && transfer_state == IDLE) begin
read_ch_data <= 1'b0;
end
end else begin
read_ch_data <= 1'b1;
end
if (adc_config_mode == SIMPLE || adc_config_mode == CRC_ENABLED) begin
if (read_ch_data == 1'b1 && rd_new_data_s == 1'b1) begin
case (channel_counter)
5'd0 : begin
adc_data_0 <= rd_data;
end
5'd1 : begin
adc_data_1 <= rd_data;
end
5'd2 : begin
adc_data_2 <= rd_data;
end
5'd3 : begin
adc_data_3 <= rd_data;
end
5'd4 : begin
adc_data_4 <= rd_data;
end
5'd5 : begin
adc_data_5 <= rd_data;
end
5'd6 : begin
adc_data_6 <= rd_data;
end
5'd7 : begin
adc_data_7 <= rd_data;
end
5'd8 : begin
adc_crc_r <= rd_data;
adc_crc_res_r <= crc_128({adc_data_0,adc_data_1,adc_data_2,adc_data_3,
adc_data_4,adc_data_5,adc_data_6,adc_data_7});
end
endcase
end
case (adc_config_mode)
SIMPLE: begin
adc_valid <= (channel_counter == 5'd8) ? rd_valid_d : 1'b0;
end
CRC_ENABLED: begin
adc_valid <= (channel_counter == 5'd9) ? rd_valid_d : 1'b0;
end
endcase
end else if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
if (read_ch_data == 1'b1 && rd_new_data_s == 1'b1) begin
case (channel_counter)
5'd0: begin
adc_data_0 <= rd_data;
end
5'd1: begin
adc_status_0 <= rd_data[15:8];
end
5'd2: begin
adc_data_1 <= rd_data;
end
5'd3: begin
adc_status_1 <= rd_data[15:8];
end
5'd4: begin
adc_data_2 <= rd_data;
end
5'd5: begin
adc_status_2 <= rd_data[15:8];
end
5'd6: begin
adc_data_3 <= rd_data;
end
5'd7: begin
adc_status_3 <= rd_data[15:8];
end
5'd8: begin
adc_data_4 <= rd_data;
end
5'd9: begin
adc_status_4 <= rd_data[15:8];
end
5'd10: begin
adc_data_5 <= rd_data;
end
5'd11: begin
adc_status_5 <= rd_data[15:8];
end
5'd12: begin
adc_data_6 <= rd_data;
end
5'd13: begin
adc_status_6 <= rd_data[15:8];
end
5'd14: begin
adc_data_7 <= rd_data;
end
5'd15: begin
adc_status_7 <= rd_data[15:8];
end
5'd16: begin
adc_crc_r <= rd_data;
adc_crc_res_r <= crc_256({adc_data_0,8'b0,adc_status_0,adc_data_1,8'b0,adc_status_1,adc_data_2,8'b0,adc_status_2,
adc_data_3,8'b0,adc_status_3,adc_data_4,8'b0,adc_status_4,adc_data_5,8'b0,adc_status_5,
adc_data_6,8'b0,adc_status_6,adc_data_7,8'b0,adc_status_7});
end
endcase
end
if (adc_config_mode == STATUS_HEADER) begin
adc_valid <= (channel_counter == 5'd16) ? rd_valid_d : 1'b0;
end else if (adc_config_mode == CRC_STATUS) begin
adc_valid <= (channel_counter == 5'd17) ? rd_valid_d : 1'b0;
end
end
end
function [15:0] crc_128;
input [127:0] d;
begin
crc_128[0] = d[0] ^ d[2] ^ d[3] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[13] ^ d[18] ^ d[19] ^ d[23] ^ d[24] ^ d[25] ^ d[26] ^ d[28] ^ d[29] ^ d[32] ^ d[35] ^ d[36] ^ d[38] ^ d[42] ^ d[46] ^ d[51] ^ d[52] ^ d[54] ^ d[55] ^ d[56] ^ d[60] ^ d[61] ^ d[62] ^ d[64] ^ d[69] ^ d[70] ^ d[75] ^ d[77] ^ d[78] ^ d[82] ^ d[83] ^ d[84] ^ d[86] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[92] ^ d[95] ^ d[97] ^ d[98] ^ d[99] ^ d[104] ^ d[111] ^ d[112] ^ d[113] ^ d[114] ^ d[119] ^ d[120] ^ d[121] ^ d[123] ^ d[124] ^ d[125];
crc_128[1] = d[0] ^ d[1] ^ d[2] ^ d[4] ^ d[6] ^ d[11] ^ d[13] ^ d[14] ^ d[18] ^ d[20] ^ d[23] ^ d[27] ^ d[28] ^ d[30] ^ d[32] ^ d[33] ^ d[35] ^ d[37] ^ d[38] ^ d[39] ^ d[42] ^ d[43] ^ d[46] ^ d[47] ^ d[51] ^ d[53] ^ d[54] ^ d[57] ^ d[60] ^ d[63] ^ d[64] ^ d[65] ^ d[69] ^ d[71] ^ d[75] ^ d[76] ^ d[77] ^ d[79] ^ d[82] ^ d[85] ^ d[86] ^ d[87] ^ d[88] ^ d[93] ^ d[95] ^ d[96] ^ d[97] ^ d[100] ^ d[104] ^ d[105] ^ d[111] ^ d[115] ^ d[119] ^ d[122] ^ d[123] ^ d[126];
crc_128[2] = d[1] ^ d[2] ^ d[3] ^ d[5] ^ d[7] ^ d[12] ^ d[14] ^ d[15] ^ d[19] ^ d[21] ^ d[24] ^ d[28] ^ d[29] ^ d[31] ^ d[33] ^ d[34] ^ d[36] ^ d[38] ^ d[39] ^ d[40] ^ d[43] ^ d[44] ^ d[47] ^ d[48] ^ d[52] ^ d[54] ^ d[55] ^ d[58] ^ d[61] ^ d[64] ^ d[65] ^ d[66] ^ d[70] ^ d[72] ^ d[76] ^ d[77] ^ d[78] ^ d[80] ^ d[83] ^ d[86] ^ d[87] ^ d[88] ^ d[89] ^ d[94] ^ d[96] ^ d[97] ^ d[98] ^ d[101] ^ d[105] ^ d[106] ^ d[112] ^ d[116] ^ d[120] ^ d[123] ^ d[124] ^ d[127];
crc_128[3] = d[0] ^ d[4] ^ d[7] ^ d[9] ^ d[10] ^ d[15] ^ d[16] ^ d[18] ^ d[19] ^ d[20] ^ d[22] ^ d[23] ^ d[24] ^ d[26] ^ d[28] ^ d[30] ^ d[34] ^ d[36] ^ d[37] ^ d[38] ^ d[39] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[45] ^ d[46] ^ d[48] ^ d[49] ^ d[51] ^ d[52] ^ d[53] ^ d[54] ^ d[59] ^ d[60] ^ d[61] ^ d[64] ^ d[65] ^ d[66] ^ d[67] ^ d[69] ^ d[70] ^ d[71] ^ d[73] ^ d[75] ^ d[79] ^ d[81] ^ d[82] ^ d[83] ^ d[86] ^ d[87] ^ d[91] ^ d[92] ^ d[102] ^ d[104] ^ d[106] ^ d[107] ^ d[111] ^ d[112] ^ d[114] ^ d[117] ^ d[119] ^ d[120] ^ d[123];
crc_128[4] = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[5] ^ d[6] ^ d[7] ^ d[9] ^ d[11] ^ d[13] ^ d[16] ^ d[17] ^ d[18] ^ d[20] ^ d[21] ^ d[26] ^ d[27] ^ d[28] ^ d[31] ^ d[32] ^ d[36] ^ d[37] ^ d[39] ^ d[40] ^ d[41] ^ d[43] ^ d[45] ^ d[47] ^ d[49] ^ d[50] ^ d[51] ^ d[53] ^ d[56] ^ d[64] ^ d[65] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[71] ^ d[72] ^ d[74] ^ d[75] ^ d[76] ^ d[77] ^ d[78] ^ d[80] ^ d[86] ^ d[87] ^ d[89] ^ d[90] ^ d[91] ^ d[93] ^ d[95] ^ d[97] ^ d[98] ^ d[99] ^ d[103] ^ d[104] ^ d[105] ^ d[107] ^ d[108] ^ d[111] ^ d[114] ^ d[115] ^ d[118] ^ d[119] ^ d[123] ^ d[125];
crc_128[5] = d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[6] ^ d[7] ^ d[8] ^ d[10] ^ d[12] ^ d[14] ^ d[17] ^ d[18] ^ d[19] ^ d[21] ^ d[22] ^ d[27] ^ d[28] ^ d[29] ^ d[32] ^ d[33] ^ d[37] ^ d[38] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[46] ^ d[48] ^ d[50] ^ d[51] ^ d[52] ^ d[54] ^ d[57] ^ d[65] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[70] ^ d[72] ^ d[73] ^ d[75] ^ d[76] ^ d[77] ^ d[78] ^ d[79] ^ d[81] ^ d[87] ^ d[88] ^ d[90] ^ d[91] ^ d[92] ^ d[94] ^ d[96] ^ d[98] ^ d[99] ^ d[100] ^ d[104] ^ d[105] ^ d[106] ^ d[108] ^ d[109] ^ d[112] ^ d[115] ^ d[116] ^ d[119] ^ d[120] ^ d[124] ^ d[126];
crc_128[6] = d[0] ^ d[4] ^ d[5] ^ d[6] ^ d[10] ^ d[11] ^ d[15] ^ d[20] ^ d[22] ^ d[24] ^ d[25] ^ d[26] ^ d[30] ^ d[32] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[39] ^ d[41] ^ d[43] ^ d[45] ^ d[46] ^ d[47] ^ d[49] ^ d[53] ^ d[54] ^ d[56] ^ d[58] ^ d[60] ^ d[61] ^ d[62] ^ d[64] ^ d[66] ^ d[67] ^ d[68] ^ d[71] ^ d[73] ^ d[74] ^ d[75] ^ d[76] ^ d[79] ^ d[80] ^ d[83] ^ d[84] ^ d[86] ^ d[90] ^ d[93] ^ d[98] ^ d[100] ^ d[101] ^ d[104] ^ d[105] ^ d[106] ^ d[107] ^ d[109] ^ d[110] ^ d[111] ^ d[112] ^ d[114] ^ d[116] ^ d[117] ^ d[119] ^ d[123] ^ d[124] ^ d[127];
crc_128[7] = d[1] ^ d[5] ^ d[6] ^ d[7] ^ d[11] ^ d[12] ^ d[16] ^ d[21] ^ d[23] ^ d[25] ^ d[26] ^ d[27] ^ d[31] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[37] ^ d[40] ^ d[42] ^ d[44] ^ d[46] ^ d[47] ^ d[48] ^ d[50] ^ d[54] ^ d[55] ^ d[57] ^ d[59] ^ d[61] ^ d[62] ^ d[63] ^ d[65] ^ d[67] ^ d[68] ^ d[69] ^ d[72] ^ d[74] ^ d[75] ^ d[76] ^ d[77] ^ d[80] ^ d[81] ^ d[84] ^ d[85] ^ d[87] ^ d[91] ^ d[94] ^ d[99] ^ d[101] ^ d[102] ^ d[105] ^ d[106] ^ d[107] ^ d[108] ^ d[110] ^ d[111] ^ d[112] ^ d[113] ^ d[115] ^ d[117] ^ d[118] ^ d[120] ^ d[124] ^ d[125];
crc_128[8] = d[0] ^ d[3] ^ d[9] ^ d[10] ^ d[12] ^ d[17] ^ d[18] ^ d[19] ^ d[22] ^ d[23] ^ d[25] ^ d[27] ^ d[29] ^ d[34] ^ d[37] ^ d[41] ^ d[42] ^ d[43] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[52] ^ d[54] ^ d[58] ^ d[61] ^ d[63] ^ d[66] ^ d[68] ^ d[73] ^ d[76] ^ d[81] ^ d[83] ^ d[84] ^ d[85] ^ d[89] ^ d[90] ^ d[91] ^ d[97] ^ d[98] ^ d[99] ^ d[100] ^ d[102] ^ d[103] ^ d[104] ^ d[106] ^ d[107] ^ d[108] ^ d[109] ^ d[116] ^ d[118] ^ d[120] ^ d[123] ^ d[124] ^ d[126];
crc_128[9] = d[1] ^ d[4] ^ d[10] ^ d[11] ^ d[13] ^ d[18] ^ d[19] ^ d[20] ^ d[23] ^ d[24] ^ d[26] ^ d[28] ^ d[30] ^ d[35] ^ d[38] ^ d[42] ^ d[43] ^ d[44] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[53] ^ d[55] ^ d[59] ^ d[62] ^ d[64] ^ d[67] ^ d[69] ^ d[74] ^ d[77] ^ d[82] ^ d[84] ^ d[85] ^ d[86] ^ d[90] ^ d[91] ^ d[92] ^ d[98] ^ d[99] ^ d[100] ^ d[101] ^ d[103] ^ d[104] ^ d[105] ^ d[107] ^ d[108] ^ d[109] ^ d[110] ^ d[117] ^ d[119] ^ d[121] ^ d[124] ^ d[125] ^ d[127];
crc_128[10] = d[0] ^ d[3] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[18] ^ d[20] ^ d[21] ^ d[23] ^ d[26] ^ d[27] ^ d[28] ^ d[31] ^ d[32] ^ d[35] ^ d[38] ^ d[39] ^ d[42] ^ d[43] ^ d[44] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[52] ^ d[55] ^ d[61] ^ d[62] ^ d[63] ^ d[64] ^ d[65] ^ d[68] ^ d[69] ^ d[77] ^ d[82] ^ d[84] ^ d[85] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[93] ^ d[95] ^ d[97] ^ d[98] ^ d[100] ^ d[101] ^ d[102] ^ d[105] ^ d[106] ^ d[108] ^ d[109] ^ d[110] ^ d[112] ^ d[113] ^ d[114] ^ d[118] ^ d[119] ^ d[121] ^ d[122] ^ d[123] ^ d[124] ^ d[126];
crc_128[11] = d[1] ^ d[4] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[15] ^ d[19] ^ d[21] ^ d[22] ^ d[24] ^ d[27] ^ d[28] ^ d[29] ^ d[32] ^ d[33] ^ d[36] ^ d[39] ^ d[40] ^ d[43] ^ d[44] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[51] ^ d[53] ^ d[56] ^ d[62] ^ d[63] ^ d[64] ^ d[65] ^ d[66] ^ d[69] ^ d[70] ^ d[78] ^ d[83] ^ d[85] ^ d[86] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[94] ^ d[96] ^ d[98] ^ d[99] ^ d[101] ^ d[102] ^ d[103] ^ d[106] ^ d[107] ^ d[109] ^ d[110] ^ d[111] ^ d[113] ^ d[114] ^ d[115] ^ d[119] ^ d[120] ^ d[122] ^ d[123] ^ d[124] ^ d[125] ^ d[127];
crc_128[12] = d[0] ^ d[3] ^ d[5] ^ d[6] ^ d[11] ^ d[12] ^ d[14] ^ d[15] ^ d[16] ^ d[18] ^ d[19] ^ d[20] ^ d[22] ^ d[24] ^ d[26] ^ d[30] ^ d[32] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[37] ^ d[38] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[45] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[55] ^ d[56] ^ d[57] ^ d[60] ^ d[61] ^ d[62] ^ d[63] ^ d[65] ^ d[66] ^ d[67] ^ d[69] ^ d[71] ^ d[75] ^ d[77] ^ d[78] ^ d[79] ^ d[82] ^ d[83] ^ d[87] ^ d[88] ^ d[98] ^ d[100] ^ d[102] ^ d[103] ^ d[107] ^ d[108] ^ d[110] ^ d[113] ^ d[115] ^ d[116] ^ d[119] ^ d[126];
crc_128[13] = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[8] ^ d[9] ^ d[10] ^ d[12] ^ d[15] ^ d[16] ^ d[17] ^ d[18] ^ d[20] ^ d[21] ^ d[24] ^ d[26] ^ d[27] ^ d[28] ^ d[29] ^ d[31] ^ d[32] ^ d[33] ^ d[34] ^ d[37] ^ d[39] ^ d[41] ^ d[43] ^ d[45] ^ d[48] ^ d[49] ^ d[50] ^ d[52] ^ d[54] ^ d[55] ^ d[57] ^ d[58] ^ d[60] ^ d[63] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[72] ^ d[75] ^ d[76] ^ d[77] ^ d[79] ^ d[80] ^ d[82] ^ d[86] ^ d[90] ^ d[91] ^ d[92] ^ d[95] ^ d[97] ^ d[98] ^ d[101] ^ d[103] ^ d[108] ^ d[109] ^ d[112] ^ d[113] ^ d[116] ^ d[117] ^ d[119] ^ d[121] ^ d[123] ^ d[124] ^ d[125] ^ d[127];
crc_128[14] = d[0] ^ d[1] ^ d[4] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[11] ^ d[16] ^ d[17] ^ d[21] ^ d[22] ^ d[23] ^ d[24] ^ d[26] ^ d[27] ^ d[30] ^ d[33] ^ d[34] ^ d[36] ^ d[40] ^ d[44] ^ d[49] ^ d[50] ^ d[52] ^ d[53] ^ d[54] ^ d[58] ^ d[59] ^ d[60] ^ d[62] ^ d[67] ^ d[68] ^ d[73] ^ d[75] ^ d[76] ^ d[80] ^ d[81] ^ d[82] ^ d[84] ^ d[86] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[93] ^ d[95] ^ d[96] ^ d[97] ^ d[102] ^ d[109] ^ d[110] ^ d[111] ^ d[112] ^ d[117] ^ d[118] ^ d[119] ^ d[121] ^ d[122] ^ d[123] ^ d[126];
crc_128[15] = d[1] ^ d[2] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[12] ^ d[17] ^ d[18] ^ d[22] ^ d[23] ^ d[24] ^ d[25] ^ d[27] ^ d[28] ^ d[31] ^ d[34] ^ d[35] ^ d[37] ^ d[41] ^ d[45] ^ d[50] ^ d[51] ^ d[53] ^ d[54] ^ d[55] ^ d[59] ^ d[60] ^ d[61] ^ d[63] ^ d[68] ^ d[69] ^ d[74] ^ d[76] ^ d[77] ^ d[81] ^ d[82] ^ d[83] ^ d[85] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[94] ^ d[96] ^ d[97] ^ d[98] ^ d[103] ^ d[110] ^ d[111] ^ d[112] ^ d[113] ^ d[118] ^ d[119] ^ d[120] ^ d[122] ^ d[123] ^ d[124] ^ d[127];
end
endfunction
function [15:0] crc_256;
input [255:0] d;
begin
crc_256[0] = d[0] ^ d[2] ^ d[3] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[13] ^ d[18] ^ d[19] ^ d[23] ^ d[24] ^ d[25] ^ d[26] ^ d[28] ^ d[29] ^ d[32] ^ d[35] ^ d[36] ^ d[38] ^ d[42] ^ d[46] ^ d[51] ^ d[52] ^ d[54] ^ d[55] ^ d[56] ^ d[60] ^ d[61] ^ d[62] ^ d[64] ^ d[69] ^ d[70] ^ d[75] ^ d[77] ^ d[78] ^ d[82] ^ d[83] ^ d[84] ^ d[86] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[92] ^ d[95] ^ d[97] ^ d[98] ^ d[99] ^ d[104] ^ d[111] ^ d[112] ^ d[113] ^ d[114] ^ d[119] ^ d[120] ^ d[121] ^ d[123] ^ d[124] ^ d[125] ^ d[128] ^ d[131] ^ d[133] ^ d[134] ^ d[136] ^ d[138] ^ d[139] ^ d[144] ^ d[150] ^ d[151] ^ d[153] ^ d[154] ^ d[155] ^ d[157] ^ d[158] ^ d[159] ^ d[160] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[166] ^ d[169] ^ d[172] ^ d[175] ^ d[176] ^ d[177] ^ d[178] ^ d[179] ^ d[181] ^ d[184] ^ d[186] ^ d[189] ^ d[190] ^ d[192] ^ d[193] ^ d[194] ^ d[196] ^ d[197] ^ d[198] ^ d[200] ^ d[201] ^ d[203] ^ d[204] ^ d[205] ^ d[207] ^ d[208] ^ d[210] ^ d[211] ^ d[213] ^ d[216] ^ d[218] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[224] ^ d[225] ^ d[226] ^ d[227] ^ d[229] ^ d[231] ^ d[235] ^ d[236] ^ d[241] ^ d[245] ^ d[248] ^ d[249] ^ d[252] ^ d[253] ^ d[254];
crc_256[1] = d[0] ^ d[1] ^ d[2] ^ d[4] ^ d[6] ^ d[11] ^ d[13] ^ d[14] ^ d[18] ^ d[20] ^ d[23] ^ d[27] ^ d[28] ^ d[30] ^ d[32] ^ d[33] ^ d[35] ^ d[37] ^ d[38] ^ d[39] ^ d[42] ^ d[43] ^ d[46] ^ d[47] ^ d[51] ^ d[53] ^ d[54] ^ d[57] ^ d[60] ^ d[63] ^ d[64] ^ d[65] ^ d[69] ^ d[71] ^ d[75] ^ d[76] ^ d[77] ^ d[79] ^ d[82] ^ d[85] ^ d[86] ^ d[87] ^ d[88] ^ d[93] ^ d[95] ^ d[96] ^ d[97] ^ d[100] ^ d[104] ^ d[105] ^ d[111] ^ d[115] ^ d[119] ^ d[122] ^ d[123] ^ d[126] ^ d[128] ^ d[129] ^ d[131] ^ d[132] ^ d[133] ^ d[135] ^ d[136] ^ d[137] ^ d[138] ^ d[140] ^ d[144] ^ d[145] ^ d[150] ^ d[152] ^ d[153] ^ d[156] ^ d[157] ^ d[161] ^ d[162] ^ d[167] ^ d[169] ^ d[170] ^ d[172] ^ d[173] ^ d[175] ^ d[180] ^ d[181] ^ d[182] ^ d[184] ^ d[185] ^ d[186] ^ d[187] ^ d[189] ^ d[191] ^ d[192] ^ d[195] ^ d[196] ^ d[199] ^ d[200] ^ d[202] ^ d[203] ^ d[206] ^ d[207] ^ d[209] ^ d[210] ^ d[212] ^ d[213] ^ d[214] ^ d[216] ^ d[217] ^ d[218] ^ d[219] ^ d[220] ^ d[228] ^ d[229] ^ d[230] ^ d[231] ^ d[232] ^ d[235] ^ d[237] ^ d[241] ^ d[242] ^ d[245] ^ d[246] ^ d[248] ^ d[250] ^ d[252] ^ d[255];
crc_256[2] = d[1] ^ d[2] ^ d[3] ^ d[5] ^ d[7] ^ d[12] ^ d[14] ^ d[15] ^ d[19] ^ d[21] ^ d[24] ^ d[28] ^ d[29] ^ d[31] ^ d[33] ^ d[34] ^ d[36] ^ d[38] ^ d[39] ^ d[40] ^ d[43] ^ d[44] ^ d[47] ^ d[48] ^ d[52] ^ d[54] ^ d[55] ^ d[58] ^ d[61] ^ d[64] ^ d[65] ^ d[66] ^ d[70] ^ d[72] ^ d[76] ^ d[77] ^ d[78] ^ d[80] ^ d[83] ^ d[86] ^ d[87] ^ d[88] ^ d[89] ^ d[94] ^ d[96] ^ d[97] ^ d[98] ^ d[101] ^ d[105] ^ d[106] ^ d[112] ^ d[116] ^ d[120] ^ d[123] ^ d[124] ^ d[127] ^ d[129] ^ d[130] ^ d[132] ^ d[133] ^ d[134] ^ d[136] ^ d[137] ^ d[138] ^ d[139] ^ d[141] ^ d[145] ^ d[146] ^ d[151] ^ d[153] ^ d[154] ^ d[157] ^ d[158] ^ d[162] ^ d[163] ^ d[168] ^ d[170] ^ d[171] ^ d[173] ^ d[174] ^ d[176] ^ d[181] ^ d[182] ^ d[183] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[190] ^ d[192] ^ d[193] ^ d[196] ^ d[197] ^ d[200] ^ d[201] ^ d[203] ^ d[204] ^ d[207] ^ d[208] ^ d[210] ^ d[211] ^ d[213] ^ d[214] ^ d[215] ^ d[217] ^ d[218] ^ d[219] ^ d[220] ^ d[221] ^ d[229] ^ d[230] ^ d[231] ^ d[232] ^ d[233] ^ d[236] ^ d[238] ^ d[242] ^ d[243] ^ d[246] ^ d[247] ^ d[249] ^ d[251] ^ d[253];
crc_256[3] = d[0] ^ d[4] ^ d[7] ^ d[9] ^ d[10] ^ d[15] ^ d[16] ^ d[18] ^ d[19] ^ d[20] ^ d[22] ^ d[23] ^ d[24] ^ d[26] ^ d[28] ^ d[30] ^ d[34] ^ d[36] ^ d[37] ^ d[38] ^ d[39] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[45] ^ d[46] ^ d[48] ^ d[49] ^ d[51] ^ d[52] ^ d[53] ^ d[54] ^ d[59] ^ d[60] ^ d[61] ^ d[64] ^ d[65] ^ d[66] ^ d[67] ^ d[69] ^ d[70] ^ d[71] ^ d[73] ^ d[75] ^ d[79] ^ d[81] ^ d[82] ^ d[83] ^ d[86] ^ d[87] ^ d[91] ^ d[92] ^ d[102] ^ d[104] ^ d[106] ^ d[107] ^ d[111] ^ d[112] ^ d[114] ^ d[117] ^ d[119] ^ d[120] ^ d[123] ^ d[130] ^ d[135] ^ d[136] ^ d[137] ^ d[140] ^ d[142] ^ d[144] ^ d[146] ^ d[147] ^ d[150] ^ d[151] ^ d[152] ^ d[153] ^ d[157] ^ d[160] ^ d[162] ^ d[165] ^ d[166] ^ d[171] ^ d[174] ^ d[176] ^ d[178] ^ d[179] ^ d[181] ^ d[182] ^ d[183] ^ d[187] ^ d[188] ^ d[190] ^ d[191] ^ d[192] ^ d[196] ^ d[200] ^ d[202] ^ d[203] ^ d[207] ^ d[209] ^ d[210] ^ d[212] ^ d[213] ^ d[214] ^ d[215] ^ d[219] ^ d[223] ^ d[224] ^ d[225] ^ d[226] ^ d[227] ^ d[229] ^ d[230] ^ d[232] ^ d[233] ^ d[234] ^ d[235] ^ d[236] ^ d[237] ^ d[239] ^ d[241] ^ d[243] ^ d[244] ^ d[245] ^ d[247] ^ d[249] ^ d[250] ^ d[253];
crc_256[4] = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[5] ^ d[6] ^ d[7] ^ d[9] ^ d[11] ^ d[13] ^ d[16] ^ d[17] ^ d[18] ^ d[20] ^ d[21] ^ d[26] ^ d[27] ^ d[28] ^ d[31] ^ d[32] ^ d[36] ^ d[37] ^ d[39] ^ d[40] ^ d[41] ^ d[43] ^ d[45] ^ d[47] ^ d[49] ^ d[50] ^ d[51] ^ d[53] ^ d[56] ^ d[64] ^ d[65] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[71] ^ d[72] ^ d[74] ^ d[75] ^ d[76] ^ d[77] ^ d[78] ^ d[80] ^ d[86] ^ d[87] ^ d[89] ^ d[90] ^ d[91] ^ d[93] ^ d[95] ^ d[97] ^ d[98] ^ d[99] ^ d[103] ^ d[104] ^ d[105] ^ d[107] ^ d[108] ^ d[111] ^ d[114] ^ d[115] ^ d[118] ^ d[119] ^ d[123] ^ d[125] ^ d[128] ^ d[133] ^ d[134] ^ d[137] ^ d[139] ^ d[141] ^ d[143] ^ d[144] ^ d[145] ^ d[147] ^ d[148] ^ d[150] ^ d[152] ^ d[155] ^ d[157] ^ d[159] ^ d[160] ^ d[161] ^ d[162] ^ d[164] ^ d[165] ^ d[167] ^ d[169] ^ d[176] ^ d[178] ^ d[180] ^ d[181] ^ d[182] ^ d[183] ^ d[186] ^ d[188] ^ d[190] ^ d[191] ^ d[194] ^ d[196] ^ d[198] ^ d[200] ^ d[205] ^ d[207] ^ d[214] ^ d[215] ^ d[218] ^ d[221] ^ d[222] ^ d[223] ^ d[228] ^ d[229] ^ d[230] ^ d[233] ^ d[234] ^ d[237] ^ d[238] ^ d[240] ^ d[241] ^ d[242] ^ d[244] ^ d[246] ^ d[249] ^ d[250] ^ d[251] ^ d[252] ^ d[253];
crc_256[5] = d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[6] ^ d[7] ^ d[8] ^ d[10] ^ d[12] ^ d[14] ^ d[17] ^ d[18] ^ d[19] ^ d[21] ^ d[22] ^ d[27] ^ d[28] ^ d[29] ^ d[32] ^ d[33] ^ d[37] ^ d[38] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[46] ^ d[48] ^ d[50] ^ d[51] ^ d[52] ^ d[54] ^ d[57] ^ d[65] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[70] ^ d[72] ^ d[73] ^ d[75] ^ d[76] ^ d[77] ^ d[78] ^ d[79] ^ d[81] ^ d[87] ^ d[88] ^ d[90] ^ d[91] ^ d[92] ^ d[94] ^ d[96] ^ d[98] ^ d[99] ^ d[100] ^ d[104] ^ d[105] ^ d[106] ^ d[108] ^ d[109] ^ d[112] ^ d[115] ^ d[116] ^ d[119] ^ d[120] ^ d[124] ^ d[126] ^ d[129] ^ d[134] ^ d[135] ^ d[138] ^ d[140] ^ d[142] ^ d[144] ^ d[145] ^ d[146] ^ d[148] ^ d[149] ^ d[151] ^ d[153] ^ d[156] ^ d[158] ^ d[160] ^ d[161] ^ d[162] ^ d[163] ^ d[165] ^ d[166] ^ d[168] ^ d[170] ^ d[177] ^ d[179] ^ d[181] ^ d[182] ^ d[183] ^ d[184] ^ d[187] ^ d[189] ^ d[191] ^ d[192] ^ d[195] ^ d[197] ^ d[199] ^ d[201] ^ d[206] ^ d[208] ^ d[215] ^ d[216] ^ d[219] ^ d[222] ^ d[223] ^ d[224] ^ d[229] ^ d[230] ^ d[231] ^ d[234] ^ d[235] ^ d[238] ^ d[239] ^ d[241] ^ d[242] ^ d[243] ^ d[245] ^ d[247] ^ d[250] ^ d[251] ^ d[252] ^ d[253] ^ d[254];
crc_256[6] = d[0] ^ d[4] ^ d[5] ^ d[6] ^ d[10] ^ d[11] ^ d[15] ^ d[20] ^ d[22] ^ d[24] ^ d[25] ^ d[26] ^ d[30] ^ d[32] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[39] ^ d[41] ^ d[43] ^ d[45] ^ d[46] ^ d[47] ^ d[49] ^ d[53] ^ d[54] ^ d[56] ^ d[58] ^ d[60] ^ d[61] ^ d[62] ^ d[64] ^ d[66] ^ d[67] ^ d[68] ^ d[71] ^ d[73] ^ d[74] ^ d[75] ^ d[76] ^ d[79] ^ d[80] ^ d[83] ^ d[84] ^ d[86] ^ d[90] ^ d[93] ^ d[98] ^ d[100] ^ d[101] ^ d[104] ^ d[105] ^ d[106] ^ d[107] ^ d[109] ^ d[110] ^ d[111] ^ d[112] ^ d[114] ^ d[116] ^ d[117] ^ d[119] ^ d[123] ^ d[124] ^ d[127] ^ d[128] ^ d[130] ^ d[131] ^ d[133] ^ d[134] ^ d[135] ^ d[138] ^ d[141] ^ d[143] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[149] ^ d[151] ^ d[152] ^ d[153] ^ d[155] ^ d[158] ^ d[160] ^ d[161] ^ d[165] ^ d[167] ^ d[171] ^ d[172] ^ d[175] ^ d[176] ^ d[177] ^ d[179] ^ d[180] ^ d[181] ^ d[182] ^ d[183] ^ d[185] ^ d[186] ^ d[188] ^ d[189] ^ d[194] ^ d[197] ^ d[201] ^ d[202] ^ d[203] ^ d[204] ^ d[205] ^ d[208] ^ d[209] ^ d[210] ^ d[211] ^ d[213] ^ d[217] ^ d[218] ^ d[221] ^ d[222] ^ d[226] ^ d[227] ^ d[229] ^ d[230] ^ d[232] ^ d[239] ^ d[240] ^ d[241] ^ d[242] ^ d[243] ^ d[244] ^ d[245] ^ d[246] ^ d[249] ^ d[251] ^ d[255];
crc_256[7] = d[1] ^ d[5] ^ d[6] ^ d[7] ^ d[11] ^ d[12] ^ d[16] ^ d[21] ^ d[23] ^ d[25] ^ d[26] ^ d[27] ^ d[31] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[37] ^ d[40] ^ d[42] ^ d[44] ^ d[46] ^ d[47] ^ d[48] ^ d[50] ^ d[54] ^ d[55] ^ d[57] ^ d[59] ^ d[61] ^ d[62] ^ d[63] ^ d[65] ^ d[67] ^ d[68] ^ d[69] ^ d[72] ^ d[74] ^ d[75] ^ d[76] ^ d[77] ^ d[80] ^ d[81] ^ d[84] ^ d[85] ^ d[87] ^ d[91] ^ d[94] ^ d[99] ^ d[101] ^ d[102] ^ d[105] ^ d[106] ^ d[107] ^ d[108] ^ d[110] ^ d[111] ^ d[112] ^ d[113] ^ d[115] ^ d[117] ^ d[118] ^ d[120] ^ d[124] ^ d[125] ^ d[128] ^ d[129] ^ d[131] ^ d[132] ^ d[134] ^ d[135] ^ d[136] ^ d[139] ^ d[142] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[150] ^ d[152] ^ d[153] ^ d[154] ^ d[156] ^ d[159] ^ d[161] ^ d[162] ^ d[166] ^ d[168] ^ d[172] ^ d[173] ^ d[176] ^ d[177] ^ d[178] ^ d[180] ^ d[181] ^ d[182] ^ d[183] ^ d[184] ^ d[186] ^ d[187] ^ d[189] ^ d[190] ^ d[195] ^ d[198] ^ d[202] ^ d[203] ^ d[204] ^ d[205] ^ d[206] ^ d[209] ^ d[210] ^ d[211] ^ d[212] ^ d[214] ^ d[218] ^ d[219] ^ d[222] ^ d[223] ^ d[227] ^ d[228] ^ d[230] ^ d[231] ^ d[233] ^ d[240] ^ d[241] ^ d[242] ^ d[243] ^ d[244] ^ d[245] ^ d[246] ^ d[247] ^ d[250] ^ d[252];
crc_256[8] = d[0] ^ d[3] ^ d[9] ^ d[10] ^ d[12] ^ d[17] ^ d[18] ^ d[19] ^ d[22] ^ d[23] ^ d[25] ^ d[27] ^ d[29] ^ d[34] ^ d[37] ^ d[41] ^ d[42] ^ d[43] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[52] ^ d[54] ^ d[58] ^ d[61] ^ d[63] ^ d[66] ^ d[68] ^ d[73] ^ d[76] ^ d[81] ^ d[83] ^ d[84] ^ d[85] ^ d[89] ^ d[90] ^ d[91] ^ d[97] ^ d[98] ^ d[99] ^ d[100] ^ d[102] ^ d[103] ^ d[104] ^ d[106] ^ d[107] ^ d[108] ^ d[109] ^ d[116] ^ d[118] ^ d[120] ^ d[123] ^ d[124] ^ d[126] ^ d[128] ^ d[129] ^ d[130] ^ d[131] ^ d[132] ^ d[134] ^ d[135] ^ d[137] ^ d[138] ^ d[139] ^ d[140] ^ d[143] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[150] ^ d[158] ^ d[159] ^ d[164] ^ d[165] ^ d[166] ^ d[167] ^ d[172] ^ d[173] ^ d[174] ^ d[175] ^ d[176] ^ d[182] ^ d[183] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[189] ^ d[191] ^ d[192] ^ d[193] ^ d[194] ^ d[197] ^ d[198] ^ d[199] ^ d[200] ^ d[201] ^ d[206] ^ d[208] ^ d[212] ^ d[215] ^ d[216] ^ d[218] ^ d[219] ^ d[221] ^ d[222] ^ d[225] ^ d[226] ^ d[227] ^ d[228] ^ d[232] ^ d[234] ^ d[235] ^ d[236] ^ d[242] ^ d[243] ^ d[244] ^ d[246] ^ d[247] ^ d[249] ^ d[251] ^ d[252] ^ d[254];
crc_256[9] = d[1] ^ d[4] ^ d[10] ^ d[11] ^ d[13] ^ d[18] ^ d[19] ^ d[20] ^ d[23] ^ d[24] ^ d[26] ^ d[28] ^ d[30] ^ d[35] ^ d[38] ^ d[42] ^ d[43] ^ d[44] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[53] ^ d[55] ^ d[59] ^ d[62] ^ d[64] ^ d[67] ^ d[69] ^ d[74] ^ d[77] ^ d[82] ^ d[84] ^ d[85] ^ d[86] ^ d[90] ^ d[91] ^ d[92] ^ d[98] ^ d[99] ^ d[100] ^ d[101] ^ d[103] ^ d[104] ^ d[105] ^ d[107] ^ d[108] ^ d[109] ^ d[110] ^ d[117] ^ d[119] ^ d[121] ^ d[124] ^ d[125] ^ d[127] ^ d[129] ^ d[130] ^ d[131] ^ d[132] ^ d[133] ^ d[135] ^ d[136] ^ d[138] ^ d[139] ^ d[140] ^ d[141] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[150] ^ d[151] ^ d[159] ^ d[160] ^ d[165] ^ d[166] ^ d[167] ^ d[168] ^ d[173] ^ d[174] ^ d[175] ^ d[176] ^ d[177] ^ d[183] ^ d[184] ^ d[186] ^ d[187] ^ d[188] ^ d[189] ^ d[190] ^ d[192] ^ d[193] ^ d[194] ^ d[195] ^ d[198] ^ d[199] ^ d[200] ^ d[201] ^ d[202] ^ d[207] ^ d[209] ^ d[213] ^ d[216] ^ d[217] ^ d[219] ^ d[220] ^ d[222] ^ d[223] ^ d[226] ^ d[227] ^ d[228] ^ d[229] ^ d[233] ^ d[235] ^ d[236] ^ d[237] ^ d[243] ^ d[244] ^ d[245] ^ d[247] ^ d[248] ^ d[250] ^ d[252] ^ d[253] ^ d[255];
crc_256[10] = d[0] ^ d[3] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[18] ^ d[20] ^ d[21] ^ d[23] ^ d[26] ^ d[27] ^ d[28] ^ d[31] ^ d[32] ^ d[35] ^ d[38] ^ d[39] ^ d[42] ^ d[43] ^ d[44] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[52] ^ d[55] ^ d[61] ^ d[62] ^ d[63] ^ d[64] ^ d[65] ^ d[68] ^ d[69] ^ d[77] ^ d[82] ^ d[84] ^ d[85] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[93] ^ d[95] ^ d[97] ^ d[98] ^ d[100] ^ d[101] ^ d[102] ^ d[105] ^ d[106] ^ d[108] ^ d[109] ^ d[110] ^ d[112] ^ d[113] ^ d[114] ^ d[118] ^ d[119] ^ d[121] ^ d[122] ^ d[123] ^ d[124] ^ d[126] ^ d[130] ^ d[132] ^ d[137] ^ d[138] ^ d[140] ^ d[141] ^ d[142] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[152] ^ d[153] ^ d[154] ^ d[155] ^ d[157] ^ d[158] ^ d[159] ^ d[161] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[167] ^ d[168] ^ d[172] ^ d[174] ^ d[179] ^ d[181] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[191] ^ d[192] ^ d[195] ^ d[197] ^ d[198] ^ d[199] ^ d[202] ^ d[204] ^ d[205] ^ d[207] ^ d[211] ^ d[213] ^ d[214] ^ d[216] ^ d[217] ^ d[222] ^ d[225] ^ d[226] ^ d[228] ^ d[230] ^ d[231] ^ d[234] ^ d[235] ^ d[237] ^ d[238] ^ d[241] ^ d[244] ^ d[246] ^ d[251] ^ d[252];
crc_256[11] = d[1] ^ d[4] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[15] ^ d[19] ^ d[21] ^ d[22] ^ d[24] ^ d[27] ^ d[28] ^ d[29] ^ d[32] ^ d[33] ^ d[36] ^ d[39] ^ d[40] ^ d[43] ^ d[44] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[51] ^ d[53] ^ d[56] ^ d[62] ^ d[63] ^ d[64] ^ d[65] ^ d[66] ^ d[69] ^ d[70] ^ d[78] ^ d[83] ^ d[85] ^ d[86] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[94] ^ d[96] ^ d[98] ^ d[99] ^ d[101] ^ d[102] ^ d[103] ^ d[106] ^ d[107] ^ d[109] ^ d[110] ^ d[111] ^ d[113] ^ d[114] ^ d[115] ^ d[119] ^ d[120] ^ d[122] ^ d[123] ^ d[124] ^ d[125] ^ d[127] ^ d[131] ^ d[133] ^ d[138] ^ d[139] ^ d[141] ^ d[142] ^ d[143] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[150] ^ d[153] ^ d[154] ^ d[155] ^ d[156] ^ d[158] ^ d[159] ^ d[160] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[166] ^ d[168] ^ d[169] ^ d[173] ^ d[175] ^ d[180] ^ d[182] ^ d[186] ^ d[187] ^ d[188] ^ d[189] ^ d[192] ^ d[193] ^ d[196] ^ d[198] ^ d[199] ^ d[200] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[212] ^ d[214] ^ d[215] ^ d[217] ^ d[218] ^ d[223] ^ d[226] ^ d[227] ^ d[229] ^ d[231] ^ d[232] ^ d[235] ^ d[236] ^ d[238] ^ d[239] ^ d[242] ^ d[245] ^ d[247] ^ d[252] ^ d[253];
crc_256[12] = d[0] ^ d[3] ^ d[5] ^ d[6] ^ d[11] ^ d[12] ^ d[14] ^ d[15] ^ d[16] ^ d[18] ^ d[19] ^ d[20] ^ d[22] ^ d[24] ^ d[26] ^ d[30] ^ d[32] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[37] ^ d[38] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[45] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[55] ^ d[56] ^ d[57] ^ d[60] ^ d[61] ^ d[62] ^ d[63] ^ d[65] ^ d[66] ^ d[67] ^ d[69] ^ d[71] ^ d[75] ^ d[77] ^ d[78] ^ d[79] ^ d[82] ^ d[83] ^ d[87] ^ d[88] ^ d[98] ^ d[100] ^ d[102] ^ d[103] ^ d[107] ^ d[108] ^ d[110] ^ d[113] ^ d[115] ^ d[116] ^ d[119] ^ d[126] ^ d[131] ^ d[132] ^ d[133] ^ d[136] ^ d[138] ^ d[140] ^ d[142] ^ d[143] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[153] ^ d[156] ^ d[158] ^ d[161] ^ d[162] ^ d[167] ^ d[170] ^ d[172] ^ d[174] ^ d[175] ^ d[177] ^ d[178] ^ d[179] ^ d[183] ^ d[184] ^ d[186] ^ d[187] ^ d[188] ^ d[192] ^ d[196] ^ d[198] ^ d[199] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[209] ^ d[210] ^ d[211] ^ d[215] ^ d[219] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[225] ^ d[226] ^ d[228] ^ d[229] ^ d[230] ^ d[231] ^ d[232] ^ d[233] ^ d[235] ^ d[237] ^ d[239] ^ d[240] ^ d[241] ^ d[243] ^ d[245] ^ d[246] ^ d[249] ^ d[252];
crc_256[13] = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[8] ^ d[9] ^ d[10] ^ d[12] ^ d[15] ^ d[16] ^ d[17] ^ d[18] ^ d[20] ^ d[21] ^ d[24] ^ d[26] ^ d[27] ^ d[28] ^ d[29] ^ d[31] ^ d[32] ^ d[33] ^ d[34] ^ d[37] ^ d[39] ^ d[41] ^ d[43] ^ d[45] ^ d[48] ^ d[49] ^ d[50] ^ d[52] ^ d[54] ^ d[55] ^ d[57] ^ d[58] ^ d[60] ^ d[63] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[72] ^ d[75] ^ d[76] ^ d[77] ^ d[79] ^ d[80] ^ d[82] ^ d[86] ^ d[90] ^ d[91] ^ d[92] ^ d[95] ^ d[97] ^ d[98] ^ d[101] ^ d[103] ^ d[108] ^ d[109] ^ d[112] ^ d[113] ^ d[116] ^ d[117] ^ d[119] ^ d[121] ^ d[123] ^ d[124] ^ d[125] ^ d[127] ^ d[128] ^ d[131] ^ d[132] ^ d[136] ^ d[137] ^ d[138] ^ d[141] ^ d[143] ^ d[147] ^ d[148] ^ d[149] ^ d[151] ^ d[153] ^ d[155] ^ d[158] ^ d[160] ^ d[164] ^ d[165] ^ d[166] ^ d[168] ^ d[169] ^ d[171] ^ d[172] ^ d[173] ^ d[177] ^ d[180] ^ d[181] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[190] ^ d[192] ^ d[194] ^ d[196] ^ d[198] ^ d[199] ^ d[201] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[209] ^ d[212] ^ d[213] ^ d[218] ^ d[225] ^ d[230] ^ d[232] ^ d[233] ^ d[234] ^ d[235] ^ d[238] ^ d[240] ^ d[242] ^ d[244] ^ d[245] ^ d[246] ^ d[247] ^ d[248] ^ d[249] ^ d[250] ^ d[252] ^ d[254];
crc_256[14] = d[0] ^ d[1] ^ d[4] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[11] ^ d[16] ^ d[17] ^ d[21] ^ d[22] ^ d[23] ^ d[24] ^ d[26] ^ d[27] ^ d[30] ^ d[33] ^ d[34] ^ d[36] ^ d[40] ^ d[44] ^ d[49] ^ d[50] ^ d[52] ^ d[53] ^ d[54] ^ d[58] ^ d[59] ^ d[60] ^ d[62] ^ d[67] ^ d[68] ^ d[73] ^ d[75] ^ d[76] ^ d[80] ^ d[81] ^ d[82] ^ d[84] ^ d[86] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[93] ^ d[95] ^ d[96] ^ d[97] ^ d[102] ^ d[109] ^ d[110] ^ d[111] ^ d[112] ^ d[117] ^ d[118] ^ d[119] ^ d[121] ^ d[122] ^ d[123] ^ d[126] ^ d[129] ^ d[131] ^ d[132] ^ d[134] ^ d[136] ^ d[137] ^ d[142] ^ d[148] ^ d[149] ^ d[151] ^ d[152] ^ d[153] ^ d[155] ^ d[156] ^ d[157] ^ d[158] ^ d[160] ^ d[161] ^ d[162] ^ d[163] ^ d[164] ^ d[167] ^ d[170] ^ d[173] ^ d[174] ^ d[175] ^ d[176] ^ d[177] ^ d[179] ^ d[182] ^ d[184] ^ d[187] ^ d[188] ^ d[190] ^ d[191] ^ d[192] ^ d[194] ^ d[195] ^ d[196] ^ d[198] ^ d[199] ^ d[201] ^ d[202] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[209] ^ d[211] ^ d[214] ^ d[216] ^ d[218] ^ d[219] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[224] ^ d[225] ^ d[227] ^ d[229] ^ d[233] ^ d[234] ^ d[239] ^ d[243] ^ d[246] ^ d[247] ^ d[250] ^ d[251] ^ d[252] ^ d[254] ^ d[255];
crc_256[15] = d[1] ^ d[2] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[12] ^ d[17] ^ d[18] ^ d[22] ^ d[23] ^ d[24] ^ d[25] ^ d[27] ^ d[28] ^ d[31] ^ d[34] ^ d[35] ^ d[37] ^ d[41] ^ d[45] ^ d[50] ^ d[51] ^ d[53] ^ d[54] ^ d[55] ^ d[59] ^ d[60] ^ d[61] ^ d[63] ^ d[68] ^ d[69] ^ d[74] ^ d[76] ^ d[77] ^ d[81] ^ d[82] ^ d[83] ^ d[85] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[94] ^ d[96] ^ d[97] ^ d[98] ^ d[103] ^ d[110] ^ d[111] ^ d[112] ^ d[113] ^ d[118] ^ d[119] ^ d[120] ^ d[122] ^ d[123] ^ d[124] ^ d[127] ^ d[130] ^ d[132] ^ d[133] ^ d[135] ^ d[137] ^ d[138] ^ d[143] ^ d[149] ^ d[150] ^ d[152] ^ d[153] ^ d[154] ^ d[156] ^ d[157] ^ d[158] ^ d[159] ^ d[161] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[168] ^ d[171] ^ d[174] ^ d[175] ^ d[176] ^ d[177] ^ d[178] ^ d[180] ^ d[183] ^ d[185] ^ d[188] ^ d[189] ^ d[191] ^ d[192] ^ d[193] ^ d[195] ^ d[196] ^ d[197] ^ d[199] ^ d[200] ^ d[202] ^ d[203] ^ d[204] ^ d[206] ^ d[207] ^ d[209] ^ d[210] ^ d[212] ^ d[215] ^ d[217] ^ d[219] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[224] ^ d[225] ^ d[226] ^ d[228] ^ d[230] ^ d[234] ^ d[235] ^ d[240] ^ d[244] ^ d[247] ^ d[248] ^ d[251] ^ d[252] ^ d[253] ^ d[255];
end
endfunction
assign adc_crc_err = (adc_crc == adc_crc_res) ? 1'b0 : 1'b1;
// FSM state register
always @(posedge clk) begin
if (rstn == 1'b0) begin
transfer_state <= 3'h0;
end else begin
transfer_state <= transfer_state_next;
end
end
// FSM next state logic
always @(*) begin
case (transfer_state)
IDLE : begin
transfer_state_next <= (start_transfer_s == 1'b1) ? CS_LOW : IDLE;
end
CS_LOW : begin
transfer_state_next <= CNTRL_LOW;
end
CNTRL_LOW : begin
transfer_state_next <= (width_counter == 4'd8) ? CNTRL_HIGH : CNTRL_LOW;
end
CNTRL_HIGH : begin
transfer_state_next <= (adc_config_enable_d | rd_conv_d) ? CS_HIGH : CNTRL_HIGH;
end
CS_HIGH : begin
transfer_state_next <= (channel_counter == nr_rd_burst || adc_config_enable_d) ? IDLE : CNTRL_LOW;
end
default : begin
transfer_state_next <= IDLE;
end
endcase
end
// data valid for the register access
assign rd_valid_s = (transfer_state == CNTRL_HIGH && rd_conv_d == 1'b1) ? 1'b1 : 1'b0;
assign adc_ctrl_status = (transfer_state == CNTRL_HIGH && (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b1)) ? 1'b1 : 1'b0;
// FSM output logic
assign db_o = wr_data;
assign rd_new_data_s = rd_valid_s & ~rd_valid_d;
always @(posedge clk) begin
rd_data <= ~rd_n ? db_i : rd_data;
rd_valid <= rd_new_data_s;
rd_valid_d <= rd_valid_s;
end
assign adc_status_er_5b = adc_status_0[7:3] | adc_status_1[7:3] | adc_status_2[7:3] | adc_status_3[7:3] | adc_status_4[7:3] | adc_status_5[7:3] | adc_status_6[7:3] | adc_status_7[7:3];
assign adc_status_er = adc_status_er_5b[0] | adc_status_er_5b[1] | adc_status_er_5b[2] | adc_status_er_5b[3] | adc_status_er_5b[4];
assign adc_status = (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) ? (adc_status_er ? 1'b0 : 1'b1) : 1'b1;
// clear adc_crc* signals if the adc_config_mode is STATUS_HEADER or SIMPLE
assign adc_crc = (adc_config_mode == STATUS_HEADER || adc_config_mode == SIMPLE) ? 16'h0 : adc_crc_r;
assign adc_crc_res = (adc_config_mode == STATUS_HEADER || adc_config_mode == SIMPLE) ? 16'h0 : adc_crc_res_r;
assign cs_n = (transfer_state == IDLE) ? 1'b1 : 1'b0;
assign db_t = (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b0) ? 1'b0 : 1'b1;
assign rd_n = (transfer_state == CNTRL_LOW) && (rd_conv_d == 1'b1 || (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b1)) ? 1'b0 : 1'b1;
assign wr_n = (transfer_state == CNTRL_LOW) && (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b0) ? 1'b0 : 1'b1;
endmodule
@@ -0,0 +1,432 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2023 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/master/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
module axi_ad7606x_18b_pif #(
parameter NEG_EDGE = 1,
parameter POS_EDGE = 0
) (
// physical interface
output cs_n,
output [15:0] db_o,
input [15:0] db_i,
output db_t,
output rd_n,
output wr_n,
input busy,
input first_data,
// FIFO interface
output reg [17:0] adc_data_0,
output reg [ 7:0] adc_status_0 = 'h0,
output reg [17:0] adc_data_1,
output reg [ 7:0] adc_status_1 = 'h0,
output reg [17:0] adc_data_2,
output reg [ 7:0] adc_status_2 = 'h0,
output reg [17:0] adc_data_3,
output reg [ 7:0] adc_status_3 = 'h0,
output reg [17:0] adc_data_4,
output reg [ 7:0] adc_status_4 = 'h0,
output reg [17:0] adc_data_5,
output reg [ 7:0] adc_status_5 = 'h0,
output reg [17:0] adc_data_6,
output reg [ 7:0] adc_status_6 = 'h0,
output reg [17:0] adc_data_7,
output reg [ 7:0] adc_status_7 = 'h0,
output adc_status,
output [15:0] adc_crc,
output [15:0] adc_crc_res,
output adc_crc_err,
output reg adc_valid,
// register access
input clk,
input rstn,
input [31:0] adc_config_ctrl,
output adc_ctrl_status,
input [15:0] wr_data,
input adc_mode_en,
input [7:0] adc_custom_control,
output reg [15:0] rd_data = 'hf,
output reg rd_valid
);
// state registers
localparam [ 2:0] IDLE = 3'h0;
localparam [ 2:0] CS_LOW = 3'h1;
localparam [ 2:0] CNTRL_LOW = 3'h2;
localparam [ 2:0] CNTRL_HIGH = 3'h3;
localparam [ 2:0] CS_HIGH = 3'h4;
localparam [ 1:0] SIMPLE = 0;
localparam [ 1:0] STATUS_HEADER = 2;
localparam [ 1:0] CRC_ENABLED = 1;
localparam [ 1:0] CRC_STATUS = 3;
// internal registers
reg [ 2:0] transfer_state = 3'h0;
reg [ 2:0] transfer_state_next = 3'h0;
reg [ 3:0] width_counter = 4'h0;
reg [ 4:0] channel_counter = 5'h0;
reg [ 4:0] nr_rd_burst = 5'h0;
reg rd_conv_d = 1'h0;
reg adc_config_enable_d = 1'h0;
reg rd_valid_d = 1'h0;
reg read_ch_data = 1'd0;
reg [ 7:0] adc_status_er_ch_id = 8'h0;
reg [15:0] adc_crc_r = 16'h0;
reg [15:0] adc_crc_res_r = 16'h0;
reg [ 1:0] adc_config_mode_r = 2'h0;
// internal wires
wire rd_req_s;
wire wr_req_s;
wire end_of_conv;
wire start_transfer_s;
wire rd_valid_s;
wire rd_new_data_s;
wire adc_config_enable;
wire adc_config_en;
wire adc_config_rd_wr;
wire [ 1:0] adc_config_mode;
wire [ 4:0] adc_status_er_5b;
wire adc_status_er;
// adc_config_rd_wr - RD (1), WR (0)
assign adc_config_enable = adc_config_ctrl[0];
assign adc_config_rd_wr = adc_config_ctrl[1];
// instantiations
ad_edge_detect #(
.EDGE(POS_EDGE)
) i_ad_edge_detect_en (
.clk (clk),
.rst (~rstn),
.signal_in (adc_config_enable),
.signal_out (adc_config_en));
ad_edge_detect #(
.EDGE(NEG_EDGE)
) i_ad_edge_detect (
.clk (clk),
.rst (~rstn),
.signal_in (busy),
.signal_out (end_of_conv));
// counters to control the RD_N and WR_N lines
assign start_transfer_s = (end_of_conv | adc_config_en) ? 1'b1 : 1'b0;
always @(posedge clk) begin
if (rstn == 1'b0) begin
adc_config_mode_r <= 2'h0;
end else begin
if (adc_mode_en) begin
if (adc_custom_control == 'h0) begin
adc_config_mode_r <= SIMPLE;
end else if (adc_custom_control == 'h1) begin
adc_config_mode_r <= CRC_ENABLED;
end else if (adc_custom_control == 'h2) begin
adc_config_mode_r <= STATUS_HEADER;
end else if (adc_custom_control == 'h3) begin
adc_config_mode_r <= CRC_STATUS;
end else begin
adc_config_mode_r <= adc_config_mode;
end
end else begin
adc_config_mode_r <= adc_config_mode;
end
end
end
assign adc_config_mode = adc_config_mode_r;
always @(negedge clk) begin
if (transfer_state == IDLE) begin
rd_conv_d <= end_of_conv;
adc_config_enable_d <= adc_config_en;
end
end
always @(posedge clk) begin
if (rstn == 1'b0) begin
width_counter <= 4'h0;
end else begin
if(transfer_state == CNTRL_LOW || transfer_state == CNTRL_HIGH) begin
width_counter <= width_counter + 1;
end else begin
width_counter <= 4'h0;
end
end
end
always @(posedge clk) begin
if (rstn == 1'b0) begin
channel_counter <= 5'h0;
end else begin
if (rd_new_data_s == 1'b1 && read_ch_data == 1'b1) begin
channel_counter <= channel_counter + 1;
end else if (transfer_state == IDLE) begin
channel_counter <= 5'h0;
end
end
end
always @(posedge clk) begin
if (adc_config_mode == SIMPLE || adc_config_mode == STATUS_HEADER) begin
nr_rd_burst = 5'd16;
if ((first_data & ~cs_n) && ~adc_config_enable_d) begin
read_ch_data <= 1'b1;
end else if (channel_counter == 5'd16 && transfer_state == IDLE) begin
read_ch_data <= 1'b0;
end
end else if (adc_config_mode == CRC_ENABLED || adc_config_mode == CRC_STATUS) begin
nr_rd_burst = 5'd17;
if ((first_data & ~cs_n) && ~adc_config_enable_d) begin
read_ch_data <= 1'b1;
end else if (channel_counter == 5'd17 && transfer_state == IDLE) begin
read_ch_data <= 1'b0;
end
end else begin
read_ch_data <= 1'b1;
end
if (read_ch_data == 1'b1 && rd_new_data_s == 1'b1) begin
case (channel_counter)
5'd0 : begin
adc_data_0[17:2] <= rd_data;
end
5'd1 : begin
adc_data_0[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_0 <= rd_data[7:0];
end
end
5'd2 : begin
adc_data_1[17:2] <= rd_data;
end
5'd3 : begin
adc_data_1[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_1 <= rd_data[7:0];
end
end
5'd4 : begin
adc_data_2[17:2] <= rd_data;
end
5'd5 : begin
adc_data_2[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_2 <= rd_data[7:0];
end
end
5'd6 : begin
adc_data_3[17:2] <= rd_data;
end
5'd7 : begin
adc_data_3[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_3 <= rd_data[7:0];
end
end
5'd8 : begin
adc_data_4[17:2] <= rd_data;
end
5'd9 : begin
adc_data_4[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_4 <= rd_data[7:0];
end
end
5'd10 : begin
adc_data_5[17:2] <= rd_data;
end
5'd11 : begin
adc_data_5[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_5 <= rd_data[7:0];
end
end
5'd12 : begin
adc_data_6[17:2] <= rd_data;
end
5'd13 : begin
adc_data_6[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_6 <= rd_data[7:0];
end
end
5'd14 : begin
adc_data_7[17:2] <= rd_data;
end
5'd15 : begin
adc_data_7[1:0] <= rd_data[15:14];
if (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) begin
adc_status_7 <= rd_data[7:0];
end
end
5'd16 : begin
adc_crc_r <= rd_data;
if (adc_config_mode == CRC_ENABLED) begin
adc_crc_res_r <= crc_256({adc_data_0,14'b0,adc_data_1,14'b0,adc_data_2,14'b0,adc_data_3,14'b0,
adc_data_4,14'b0,adc_data_5,14'b0,adc_data_6,14'b0,adc_data_7,14'b0});
end else if (adc_config_mode == CRC_STATUS) begin
adc_crc_res_r <= crc_256({adc_data_0,6'b0,adc_status_0,adc_data_1,6'b0,adc_status_1,adc_data_2,6'b0,adc_status_2,
adc_data_3,6'b0,adc_status_3,adc_data_4,6'b0,adc_status_4,adc_data_5,6'b0,adc_status_5,
adc_data_6,6'b0,adc_status_6,adc_data_7,6'b0,adc_status_7});
end
end
endcase
end
case (adc_config_mode)
SIMPLE: begin
adc_valid <= (channel_counter == 5'd16) ? rd_valid_d : 1'b0;
end
STATUS_HEADER: begin
adc_valid <= (channel_counter == 5'd16) ? rd_valid_d : 1'b0;
end
CRC_ENABLED: begin
adc_valid <= (channel_counter == 5'd17) ? rd_valid_d : 1'b0;
end
CRC_STATUS: begin
adc_valid <= (channel_counter == 5'd17) ? rd_valid_d : 1'b0;
end
endcase
end
function [15:0] crc_256;
input [255:0] d;
begin
crc_256[0] = d[0] ^ d[2] ^ d[3] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[13] ^ d[18] ^ d[19] ^ d[23] ^ d[24] ^ d[25] ^ d[26] ^ d[28] ^ d[29] ^ d[32] ^ d[35] ^ d[36] ^ d[38] ^ d[42] ^ d[46] ^ d[51] ^ d[52] ^ d[54] ^ d[55] ^ d[56] ^ d[60] ^ d[61] ^ d[62] ^ d[64] ^ d[69] ^ d[70] ^ d[75] ^ d[77] ^ d[78] ^ d[82] ^ d[83] ^ d[84] ^ d[86] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[92] ^ d[95] ^ d[97] ^ d[98] ^ d[99] ^ d[104] ^ d[111] ^ d[112] ^ d[113] ^ d[114] ^ d[119] ^ d[120] ^ d[121] ^ d[123] ^ d[124] ^ d[125] ^ d[128] ^ d[131] ^ d[133] ^ d[134] ^ d[136] ^ d[138] ^ d[139] ^ d[144] ^ d[150] ^ d[151] ^ d[153] ^ d[154] ^ d[155] ^ d[157] ^ d[158] ^ d[159] ^ d[160] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[166] ^ d[169] ^ d[172] ^ d[175] ^ d[176] ^ d[177] ^ d[178] ^ d[179] ^ d[181] ^ d[184] ^ d[186] ^ d[189] ^ d[190] ^ d[192] ^ d[193] ^ d[194] ^ d[196] ^ d[197] ^ d[198] ^ d[200] ^ d[201] ^ d[203] ^ d[204] ^ d[205] ^ d[207] ^ d[208] ^ d[210] ^ d[211] ^ d[213] ^ d[216] ^ d[218] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[224] ^ d[225] ^ d[226] ^ d[227] ^ d[229] ^ d[231] ^ d[235] ^ d[236] ^ d[241] ^ d[245] ^ d[248] ^ d[249] ^ d[252] ^ d[253] ^ d[254];
crc_256[1] = d[0] ^ d[1] ^ d[2] ^ d[4] ^ d[6] ^ d[11] ^ d[13] ^ d[14] ^ d[18] ^ d[20] ^ d[23] ^ d[27] ^ d[28] ^ d[30] ^ d[32] ^ d[33] ^ d[35] ^ d[37] ^ d[38] ^ d[39] ^ d[42] ^ d[43] ^ d[46] ^ d[47] ^ d[51] ^ d[53] ^ d[54] ^ d[57] ^ d[60] ^ d[63] ^ d[64] ^ d[65] ^ d[69] ^ d[71] ^ d[75] ^ d[76] ^ d[77] ^ d[79] ^ d[82] ^ d[85] ^ d[86] ^ d[87] ^ d[88] ^ d[93] ^ d[95] ^ d[96] ^ d[97] ^ d[100] ^ d[104] ^ d[105] ^ d[111] ^ d[115] ^ d[119] ^ d[122] ^ d[123] ^ d[126] ^ d[128] ^ d[129] ^ d[131] ^ d[132] ^ d[133] ^ d[135] ^ d[136] ^ d[137] ^ d[138] ^ d[140] ^ d[144] ^ d[145] ^ d[150] ^ d[152] ^ d[153] ^ d[156] ^ d[157] ^ d[161] ^ d[162] ^ d[167] ^ d[169] ^ d[170] ^ d[172] ^ d[173] ^ d[175] ^ d[180] ^ d[181] ^ d[182] ^ d[184] ^ d[185] ^ d[186] ^ d[187] ^ d[189] ^ d[191] ^ d[192] ^ d[195] ^ d[196] ^ d[199] ^ d[200] ^ d[202] ^ d[203] ^ d[206] ^ d[207] ^ d[209] ^ d[210] ^ d[212] ^ d[213] ^ d[214] ^ d[216] ^ d[217] ^ d[218] ^ d[219] ^ d[220] ^ d[228] ^ d[229] ^ d[230] ^ d[231] ^ d[232] ^ d[235] ^ d[237] ^ d[241] ^ d[242] ^ d[245] ^ d[246] ^ d[248] ^ d[250] ^ d[252] ^ d[255];
crc_256[2] = d[1] ^ d[2] ^ d[3] ^ d[5] ^ d[7] ^ d[12] ^ d[14] ^ d[15] ^ d[19] ^ d[21] ^ d[24] ^ d[28] ^ d[29] ^ d[31] ^ d[33] ^ d[34] ^ d[36] ^ d[38] ^ d[39] ^ d[40] ^ d[43] ^ d[44] ^ d[47] ^ d[48] ^ d[52] ^ d[54] ^ d[55] ^ d[58] ^ d[61] ^ d[64] ^ d[65] ^ d[66] ^ d[70] ^ d[72] ^ d[76] ^ d[77] ^ d[78] ^ d[80] ^ d[83] ^ d[86] ^ d[87] ^ d[88] ^ d[89] ^ d[94] ^ d[96] ^ d[97] ^ d[98] ^ d[101] ^ d[105] ^ d[106] ^ d[112] ^ d[116] ^ d[120] ^ d[123] ^ d[124] ^ d[127] ^ d[129] ^ d[130] ^ d[132] ^ d[133] ^ d[134] ^ d[136] ^ d[137] ^ d[138] ^ d[139] ^ d[141] ^ d[145] ^ d[146] ^ d[151] ^ d[153] ^ d[154] ^ d[157] ^ d[158] ^ d[162] ^ d[163] ^ d[168] ^ d[170] ^ d[171] ^ d[173] ^ d[174] ^ d[176] ^ d[181] ^ d[182] ^ d[183] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[190] ^ d[192] ^ d[193] ^ d[196] ^ d[197] ^ d[200] ^ d[201] ^ d[203] ^ d[204] ^ d[207] ^ d[208] ^ d[210] ^ d[211] ^ d[213] ^ d[214] ^ d[215] ^ d[217] ^ d[218] ^ d[219] ^ d[220] ^ d[221] ^ d[229] ^ d[230] ^ d[231] ^ d[232] ^ d[233] ^ d[236] ^ d[238] ^ d[242] ^ d[243] ^ d[246] ^ d[247] ^ d[249] ^ d[251] ^ d[253];
crc_256[3] = d[0] ^ d[4] ^ d[7] ^ d[9] ^ d[10] ^ d[15] ^ d[16] ^ d[18] ^ d[19] ^ d[20] ^ d[22] ^ d[23] ^ d[24] ^ d[26] ^ d[28] ^ d[30] ^ d[34] ^ d[36] ^ d[37] ^ d[38] ^ d[39] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[45] ^ d[46] ^ d[48] ^ d[49] ^ d[51] ^ d[52] ^ d[53] ^ d[54] ^ d[59] ^ d[60] ^ d[61] ^ d[64] ^ d[65] ^ d[66] ^ d[67] ^ d[69] ^ d[70] ^ d[71] ^ d[73] ^ d[75] ^ d[79] ^ d[81] ^ d[82] ^ d[83] ^ d[86] ^ d[87] ^ d[91] ^ d[92] ^ d[102] ^ d[104] ^ d[106] ^ d[107] ^ d[111] ^ d[112] ^ d[114] ^ d[117] ^ d[119] ^ d[120] ^ d[123] ^ d[130] ^ d[135] ^ d[136] ^ d[137] ^ d[140] ^ d[142] ^ d[144] ^ d[146] ^ d[147] ^ d[150] ^ d[151] ^ d[152] ^ d[153] ^ d[157] ^ d[160] ^ d[162] ^ d[165] ^ d[166] ^ d[171] ^ d[174] ^ d[176] ^ d[178] ^ d[179] ^ d[181] ^ d[182] ^ d[183] ^ d[187] ^ d[188] ^ d[190] ^ d[191] ^ d[192] ^ d[196] ^ d[200] ^ d[202] ^ d[203] ^ d[207] ^ d[209] ^ d[210] ^ d[212] ^ d[213] ^ d[214] ^ d[215] ^ d[219] ^ d[223] ^ d[224] ^ d[225] ^ d[226] ^ d[227] ^ d[229] ^ d[230] ^ d[232] ^ d[233] ^ d[234] ^ d[235] ^ d[236] ^ d[237] ^ d[239] ^ d[241] ^ d[243] ^ d[244] ^ d[245] ^ d[247] ^ d[249] ^ d[250] ^ d[253];
crc_256[4] = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[5] ^ d[6] ^ d[7] ^ d[9] ^ d[11] ^ d[13] ^ d[16] ^ d[17] ^ d[18] ^ d[20] ^ d[21] ^ d[26] ^ d[27] ^ d[28] ^ d[31] ^ d[32] ^ d[36] ^ d[37] ^ d[39] ^ d[40] ^ d[41] ^ d[43] ^ d[45] ^ d[47] ^ d[49] ^ d[50] ^ d[51] ^ d[53] ^ d[56] ^ d[64] ^ d[65] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[71] ^ d[72] ^ d[74] ^ d[75] ^ d[76] ^ d[77] ^ d[78] ^ d[80] ^ d[86] ^ d[87] ^ d[89] ^ d[90] ^ d[91] ^ d[93] ^ d[95] ^ d[97] ^ d[98] ^ d[99] ^ d[103] ^ d[104] ^ d[105] ^ d[107] ^ d[108] ^ d[111] ^ d[114] ^ d[115] ^ d[118] ^ d[119] ^ d[123] ^ d[125] ^ d[128] ^ d[133] ^ d[134] ^ d[137] ^ d[139] ^ d[141] ^ d[143] ^ d[144] ^ d[145] ^ d[147] ^ d[148] ^ d[150] ^ d[152] ^ d[155] ^ d[157] ^ d[159] ^ d[160] ^ d[161] ^ d[162] ^ d[164] ^ d[165] ^ d[167] ^ d[169] ^ d[176] ^ d[178] ^ d[180] ^ d[181] ^ d[182] ^ d[183] ^ d[186] ^ d[188] ^ d[190] ^ d[191] ^ d[194] ^ d[196] ^ d[198] ^ d[200] ^ d[205] ^ d[207] ^ d[214] ^ d[215] ^ d[218] ^ d[221] ^ d[222] ^ d[223] ^ d[228] ^ d[229] ^ d[230] ^ d[233] ^ d[234] ^ d[237] ^ d[238] ^ d[240] ^ d[241] ^ d[242] ^ d[244] ^ d[246] ^ d[249] ^ d[250] ^ d[251] ^ d[252] ^ d[253];
crc_256[5] = d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[6] ^ d[7] ^ d[8] ^ d[10] ^ d[12] ^ d[14] ^ d[17] ^ d[18] ^ d[19] ^ d[21] ^ d[22] ^ d[27] ^ d[28] ^ d[29] ^ d[32] ^ d[33] ^ d[37] ^ d[38] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[46] ^ d[48] ^ d[50] ^ d[51] ^ d[52] ^ d[54] ^ d[57] ^ d[65] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[70] ^ d[72] ^ d[73] ^ d[75] ^ d[76] ^ d[77] ^ d[78] ^ d[79] ^ d[81] ^ d[87] ^ d[88] ^ d[90] ^ d[91] ^ d[92] ^ d[94] ^ d[96] ^ d[98] ^ d[99] ^ d[100] ^ d[104] ^ d[105] ^ d[106] ^ d[108] ^ d[109] ^ d[112] ^ d[115] ^ d[116] ^ d[119] ^ d[120] ^ d[124] ^ d[126] ^ d[129] ^ d[134] ^ d[135] ^ d[138] ^ d[140] ^ d[142] ^ d[144] ^ d[145] ^ d[146] ^ d[148] ^ d[149] ^ d[151] ^ d[153] ^ d[156] ^ d[158] ^ d[160] ^ d[161] ^ d[162] ^ d[163] ^ d[165] ^ d[166] ^ d[168] ^ d[170] ^ d[177] ^ d[179] ^ d[181] ^ d[182] ^ d[183] ^ d[184] ^ d[187] ^ d[189] ^ d[191] ^ d[192] ^ d[195] ^ d[197] ^ d[199] ^ d[201] ^ d[206] ^ d[208] ^ d[215] ^ d[216] ^ d[219] ^ d[222] ^ d[223] ^ d[224] ^ d[229] ^ d[230] ^ d[231] ^ d[234] ^ d[235] ^ d[238] ^ d[239] ^ d[241] ^ d[242] ^ d[243] ^ d[245] ^ d[247] ^ d[250] ^ d[251] ^ d[252] ^ d[253] ^ d[254];
crc_256[6] = d[0] ^ d[4] ^ d[5] ^ d[6] ^ d[10] ^ d[11] ^ d[15] ^ d[20] ^ d[22] ^ d[24] ^ d[25] ^ d[26] ^ d[30] ^ d[32] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[39] ^ d[41] ^ d[43] ^ d[45] ^ d[46] ^ d[47] ^ d[49] ^ d[53] ^ d[54] ^ d[56] ^ d[58] ^ d[60] ^ d[61] ^ d[62] ^ d[64] ^ d[66] ^ d[67] ^ d[68] ^ d[71] ^ d[73] ^ d[74] ^ d[75] ^ d[76] ^ d[79] ^ d[80] ^ d[83] ^ d[84] ^ d[86] ^ d[90] ^ d[93] ^ d[98] ^ d[100] ^ d[101] ^ d[104] ^ d[105] ^ d[106] ^ d[107] ^ d[109] ^ d[110] ^ d[111] ^ d[112] ^ d[114] ^ d[116] ^ d[117] ^ d[119] ^ d[123] ^ d[124] ^ d[127] ^ d[128] ^ d[130] ^ d[131] ^ d[133] ^ d[134] ^ d[135] ^ d[138] ^ d[141] ^ d[143] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[149] ^ d[151] ^ d[152] ^ d[153] ^ d[155] ^ d[158] ^ d[160] ^ d[161] ^ d[165] ^ d[167] ^ d[171] ^ d[172] ^ d[175] ^ d[176] ^ d[177] ^ d[179] ^ d[180] ^ d[181] ^ d[182] ^ d[183] ^ d[185] ^ d[186] ^ d[188] ^ d[189] ^ d[194] ^ d[197] ^ d[201] ^ d[202] ^ d[203] ^ d[204] ^ d[205] ^ d[208] ^ d[209] ^ d[210] ^ d[211] ^ d[213] ^ d[217] ^ d[218] ^ d[221] ^ d[222] ^ d[226] ^ d[227] ^ d[229] ^ d[230] ^ d[232] ^ d[239] ^ d[240] ^ d[241] ^ d[242] ^ d[243] ^ d[244] ^ d[245] ^ d[246] ^ d[249] ^ d[251] ^ d[255];
crc_256[7] = d[1] ^ d[5] ^ d[6] ^ d[7] ^ d[11] ^ d[12] ^ d[16] ^ d[21] ^ d[23] ^ d[25] ^ d[26] ^ d[27] ^ d[31] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[37] ^ d[40] ^ d[42] ^ d[44] ^ d[46] ^ d[47] ^ d[48] ^ d[50] ^ d[54] ^ d[55] ^ d[57] ^ d[59] ^ d[61] ^ d[62] ^ d[63] ^ d[65] ^ d[67] ^ d[68] ^ d[69] ^ d[72] ^ d[74] ^ d[75] ^ d[76] ^ d[77] ^ d[80] ^ d[81] ^ d[84] ^ d[85] ^ d[87] ^ d[91] ^ d[94] ^ d[99] ^ d[101] ^ d[102] ^ d[105] ^ d[106] ^ d[107] ^ d[108] ^ d[110] ^ d[111] ^ d[112] ^ d[113] ^ d[115] ^ d[117] ^ d[118] ^ d[120] ^ d[124] ^ d[125] ^ d[128] ^ d[129] ^ d[131] ^ d[132] ^ d[134] ^ d[135] ^ d[136] ^ d[139] ^ d[142] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[150] ^ d[152] ^ d[153] ^ d[154] ^ d[156] ^ d[159] ^ d[161] ^ d[162] ^ d[166] ^ d[168] ^ d[172] ^ d[173] ^ d[176] ^ d[177] ^ d[178] ^ d[180] ^ d[181] ^ d[182] ^ d[183] ^ d[184] ^ d[186] ^ d[187] ^ d[189] ^ d[190] ^ d[195] ^ d[198] ^ d[202] ^ d[203] ^ d[204] ^ d[205] ^ d[206] ^ d[209] ^ d[210] ^ d[211] ^ d[212] ^ d[214] ^ d[218] ^ d[219] ^ d[222] ^ d[223] ^ d[227] ^ d[228] ^ d[230] ^ d[231] ^ d[233] ^ d[240] ^ d[241] ^ d[242] ^ d[243] ^ d[244] ^ d[245] ^ d[246] ^ d[247] ^ d[250] ^ d[252];
crc_256[8] = d[0] ^ d[3] ^ d[9] ^ d[10] ^ d[12] ^ d[17] ^ d[18] ^ d[19] ^ d[22] ^ d[23] ^ d[25] ^ d[27] ^ d[29] ^ d[34] ^ d[37] ^ d[41] ^ d[42] ^ d[43] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[52] ^ d[54] ^ d[58] ^ d[61] ^ d[63] ^ d[66] ^ d[68] ^ d[73] ^ d[76] ^ d[81] ^ d[83] ^ d[84] ^ d[85] ^ d[89] ^ d[90] ^ d[91] ^ d[97] ^ d[98] ^ d[99] ^ d[100] ^ d[102] ^ d[103] ^ d[104] ^ d[106] ^ d[107] ^ d[108] ^ d[109] ^ d[116] ^ d[118] ^ d[120] ^ d[123] ^ d[124] ^ d[126] ^ d[128] ^ d[129] ^ d[130] ^ d[131] ^ d[132] ^ d[134] ^ d[135] ^ d[137] ^ d[138] ^ d[139] ^ d[140] ^ d[143] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[150] ^ d[158] ^ d[159] ^ d[164] ^ d[165] ^ d[166] ^ d[167] ^ d[172] ^ d[173] ^ d[174] ^ d[175] ^ d[176] ^ d[182] ^ d[183] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[189] ^ d[191] ^ d[192] ^ d[193] ^ d[194] ^ d[197] ^ d[198] ^ d[199] ^ d[200] ^ d[201] ^ d[206] ^ d[208] ^ d[212] ^ d[215] ^ d[216] ^ d[218] ^ d[219] ^ d[221] ^ d[222] ^ d[225] ^ d[226] ^ d[227] ^ d[228] ^ d[232] ^ d[234] ^ d[235] ^ d[236] ^ d[242] ^ d[243] ^ d[244] ^ d[246] ^ d[247] ^ d[249] ^ d[251] ^ d[252] ^ d[254];
crc_256[9] = d[1] ^ d[4] ^ d[10] ^ d[11] ^ d[13] ^ d[18] ^ d[19] ^ d[20] ^ d[23] ^ d[24] ^ d[26] ^ d[28] ^ d[30] ^ d[35] ^ d[38] ^ d[42] ^ d[43] ^ d[44] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[53] ^ d[55] ^ d[59] ^ d[62] ^ d[64] ^ d[67] ^ d[69] ^ d[74] ^ d[77] ^ d[82] ^ d[84] ^ d[85] ^ d[86] ^ d[90] ^ d[91] ^ d[92] ^ d[98] ^ d[99] ^ d[100] ^ d[101] ^ d[103] ^ d[104] ^ d[105] ^ d[107] ^ d[108] ^ d[109] ^ d[110] ^ d[117] ^ d[119] ^ d[121] ^ d[124] ^ d[125] ^ d[127] ^ d[129] ^ d[130] ^ d[131] ^ d[132] ^ d[133] ^ d[135] ^ d[136] ^ d[138] ^ d[139] ^ d[140] ^ d[141] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[150] ^ d[151] ^ d[159] ^ d[160] ^ d[165] ^ d[166] ^ d[167] ^ d[168] ^ d[173] ^ d[174] ^ d[175] ^ d[176] ^ d[177] ^ d[183] ^ d[184] ^ d[186] ^ d[187] ^ d[188] ^ d[189] ^ d[190] ^ d[192] ^ d[193] ^ d[194] ^ d[195] ^ d[198] ^ d[199] ^ d[200] ^ d[201] ^ d[202] ^ d[207] ^ d[209] ^ d[213] ^ d[216] ^ d[217] ^ d[219] ^ d[220] ^ d[222] ^ d[223] ^ d[226] ^ d[227] ^ d[228] ^ d[229] ^ d[233] ^ d[235] ^ d[236] ^ d[237] ^ d[243] ^ d[244] ^ d[245] ^ d[247] ^ d[248] ^ d[250] ^ d[252] ^ d[253] ^ d[255];
crc_256[10] = d[0] ^ d[3] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[18] ^ d[20] ^ d[21] ^ d[23] ^ d[26] ^ d[27] ^ d[28] ^ d[31] ^ d[32] ^ d[35] ^ d[38] ^ d[39] ^ d[42] ^ d[43] ^ d[44] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[52] ^ d[55] ^ d[61] ^ d[62] ^ d[63] ^ d[64] ^ d[65] ^ d[68] ^ d[69] ^ d[77] ^ d[82] ^ d[84] ^ d[85] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[93] ^ d[95] ^ d[97] ^ d[98] ^ d[100] ^ d[101] ^ d[102] ^ d[105] ^ d[106] ^ d[108] ^ d[109] ^ d[110] ^ d[112] ^ d[113] ^ d[114] ^ d[118] ^ d[119] ^ d[121] ^ d[122] ^ d[123] ^ d[124] ^ d[126] ^ d[130] ^ d[132] ^ d[137] ^ d[138] ^ d[140] ^ d[141] ^ d[142] ^ d[144] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[152] ^ d[153] ^ d[154] ^ d[155] ^ d[157] ^ d[158] ^ d[159] ^ d[161] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[167] ^ d[168] ^ d[172] ^ d[174] ^ d[179] ^ d[181] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[191] ^ d[192] ^ d[195] ^ d[197] ^ d[198] ^ d[199] ^ d[202] ^ d[204] ^ d[205] ^ d[207] ^ d[211] ^ d[213] ^ d[214] ^ d[216] ^ d[217] ^ d[222] ^ d[225] ^ d[226] ^ d[228] ^ d[230] ^ d[231] ^ d[234] ^ d[235] ^ d[237] ^ d[238] ^ d[241] ^ d[244] ^ d[246] ^ d[251] ^ d[252];
crc_256[11] = d[1] ^ d[4] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[15] ^ d[19] ^ d[21] ^ d[22] ^ d[24] ^ d[27] ^ d[28] ^ d[29] ^ d[32] ^ d[33] ^ d[36] ^ d[39] ^ d[40] ^ d[43] ^ d[44] ^ d[45] ^ d[46] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[51] ^ d[53] ^ d[56] ^ d[62] ^ d[63] ^ d[64] ^ d[65] ^ d[66] ^ d[69] ^ d[70] ^ d[78] ^ d[83] ^ d[85] ^ d[86] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[94] ^ d[96] ^ d[98] ^ d[99] ^ d[101] ^ d[102] ^ d[103] ^ d[106] ^ d[107] ^ d[109] ^ d[110] ^ d[111] ^ d[113] ^ d[114] ^ d[115] ^ d[119] ^ d[120] ^ d[122] ^ d[123] ^ d[124] ^ d[125] ^ d[127] ^ d[131] ^ d[133] ^ d[138] ^ d[139] ^ d[141] ^ d[142] ^ d[143] ^ d[145] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[150] ^ d[153] ^ d[154] ^ d[155] ^ d[156] ^ d[158] ^ d[159] ^ d[160] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[166] ^ d[168] ^ d[169] ^ d[173] ^ d[175] ^ d[180] ^ d[182] ^ d[186] ^ d[187] ^ d[188] ^ d[189] ^ d[192] ^ d[193] ^ d[196] ^ d[198] ^ d[199] ^ d[200] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[212] ^ d[214] ^ d[215] ^ d[217] ^ d[218] ^ d[223] ^ d[226] ^ d[227] ^ d[229] ^ d[231] ^ d[232] ^ d[235] ^ d[236] ^ d[238] ^ d[239] ^ d[242] ^ d[245] ^ d[247] ^ d[252] ^ d[253];
crc_256[12] = d[0] ^ d[3] ^ d[5] ^ d[6] ^ d[11] ^ d[12] ^ d[14] ^ d[15] ^ d[16] ^ d[18] ^ d[19] ^ d[20] ^ d[22] ^ d[24] ^ d[26] ^ d[30] ^ d[32] ^ d[33] ^ d[34] ^ d[35] ^ d[36] ^ d[37] ^ d[38] ^ d[40] ^ d[41] ^ d[42] ^ d[44] ^ d[45] ^ d[47] ^ d[48] ^ d[49] ^ d[50] ^ d[55] ^ d[56] ^ d[57] ^ d[60] ^ d[61] ^ d[62] ^ d[63] ^ d[65] ^ d[66] ^ d[67] ^ d[69] ^ d[71] ^ d[75] ^ d[77] ^ d[78] ^ d[79] ^ d[82] ^ d[83] ^ d[87] ^ d[88] ^ d[98] ^ d[100] ^ d[102] ^ d[103] ^ d[107] ^ d[108] ^ d[110] ^ d[113] ^ d[115] ^ d[116] ^ d[119] ^ d[126] ^ d[131] ^ d[132] ^ d[133] ^ d[136] ^ d[138] ^ d[140] ^ d[142] ^ d[143] ^ d[146] ^ d[147] ^ d[148] ^ d[149] ^ d[153] ^ d[156] ^ d[158] ^ d[161] ^ d[162] ^ d[167] ^ d[170] ^ d[172] ^ d[174] ^ d[175] ^ d[177] ^ d[178] ^ d[179] ^ d[183] ^ d[184] ^ d[186] ^ d[187] ^ d[188] ^ d[192] ^ d[196] ^ d[198] ^ d[199] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[209] ^ d[210] ^ d[211] ^ d[215] ^ d[219] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[225] ^ d[226] ^ d[228] ^ d[229] ^ d[230] ^ d[231] ^ d[232] ^ d[233] ^ d[235] ^ d[237] ^ d[239] ^ d[240] ^ d[241] ^ d[243] ^ d[245] ^ d[246] ^ d[249] ^ d[252];
crc_256[13] = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[8] ^ d[9] ^ d[10] ^ d[12] ^ d[15] ^ d[16] ^ d[17] ^ d[18] ^ d[20] ^ d[21] ^ d[24] ^ d[26] ^ d[27] ^ d[28] ^ d[29] ^ d[31] ^ d[32] ^ d[33] ^ d[34] ^ d[37] ^ d[39] ^ d[41] ^ d[43] ^ d[45] ^ d[48] ^ d[49] ^ d[50] ^ d[52] ^ d[54] ^ d[55] ^ d[57] ^ d[58] ^ d[60] ^ d[63] ^ d[66] ^ d[67] ^ d[68] ^ d[69] ^ d[72] ^ d[75] ^ d[76] ^ d[77] ^ d[79] ^ d[80] ^ d[82] ^ d[86] ^ d[90] ^ d[91] ^ d[92] ^ d[95] ^ d[97] ^ d[98] ^ d[101] ^ d[103] ^ d[108] ^ d[109] ^ d[112] ^ d[113] ^ d[116] ^ d[117] ^ d[119] ^ d[121] ^ d[123] ^ d[124] ^ d[125] ^ d[127] ^ d[128] ^ d[131] ^ d[132] ^ d[136] ^ d[137] ^ d[138] ^ d[141] ^ d[143] ^ d[147] ^ d[148] ^ d[149] ^ d[151] ^ d[153] ^ d[155] ^ d[158] ^ d[160] ^ d[164] ^ d[165] ^ d[166] ^ d[168] ^ d[169] ^ d[171] ^ d[172] ^ d[173] ^ d[177] ^ d[180] ^ d[181] ^ d[185] ^ d[186] ^ d[187] ^ d[188] ^ d[190] ^ d[192] ^ d[194] ^ d[196] ^ d[198] ^ d[199] ^ d[201] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[209] ^ d[212] ^ d[213] ^ d[218] ^ d[225] ^ d[230] ^ d[232] ^ d[233] ^ d[234] ^ d[235] ^ d[238] ^ d[240] ^ d[242] ^ d[244] ^ d[245] ^ d[246] ^ d[247] ^ d[248] ^ d[249] ^ d[250] ^ d[252] ^ d[254];
crc_256[14] = d[0] ^ d[1] ^ d[4] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[11] ^ d[16] ^ d[17] ^ d[21] ^ d[22] ^ d[23] ^ d[24] ^ d[26] ^ d[27] ^ d[30] ^ d[33] ^ d[34] ^ d[36] ^ d[40] ^ d[44] ^ d[49] ^ d[50] ^ d[52] ^ d[53] ^ d[54] ^ d[58] ^ d[59] ^ d[60] ^ d[62] ^ d[67] ^ d[68] ^ d[73] ^ d[75] ^ d[76] ^ d[80] ^ d[81] ^ d[82] ^ d[84] ^ d[86] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[93] ^ d[95] ^ d[96] ^ d[97] ^ d[102] ^ d[109] ^ d[110] ^ d[111] ^ d[112] ^ d[117] ^ d[118] ^ d[119] ^ d[121] ^ d[122] ^ d[123] ^ d[126] ^ d[129] ^ d[131] ^ d[132] ^ d[134] ^ d[136] ^ d[137] ^ d[142] ^ d[148] ^ d[149] ^ d[151] ^ d[152] ^ d[153] ^ d[155] ^ d[156] ^ d[157] ^ d[158] ^ d[160] ^ d[161] ^ d[162] ^ d[163] ^ d[164] ^ d[167] ^ d[170] ^ d[173] ^ d[174] ^ d[175] ^ d[176] ^ d[177] ^ d[179] ^ d[182] ^ d[184] ^ d[187] ^ d[188] ^ d[190] ^ d[191] ^ d[192] ^ d[194] ^ d[195] ^ d[196] ^ d[198] ^ d[199] ^ d[201] ^ d[202] ^ d[203] ^ d[205] ^ d[206] ^ d[208] ^ d[209] ^ d[211] ^ d[214] ^ d[216] ^ d[218] ^ d[219] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[224] ^ d[225] ^ d[227] ^ d[229] ^ d[233] ^ d[234] ^ d[239] ^ d[243] ^ d[246] ^ d[247] ^ d[250] ^ d[251] ^ d[252] ^ d[254] ^ d[255];
crc_256[15] = d[1] ^ d[2] ^ d[5] ^ d[6] ^ d[7] ^ d[8] ^ d[9] ^ d[12] ^ d[17] ^ d[18] ^ d[22] ^ d[23] ^ d[24] ^ d[25] ^ d[27] ^ d[28] ^ d[31] ^ d[34] ^ d[35] ^ d[37] ^ d[41] ^ d[45] ^ d[50] ^ d[51] ^ d[53] ^ d[54] ^ d[55] ^ d[59] ^ d[60] ^ d[61] ^ d[63] ^ d[68] ^ d[69] ^ d[74] ^ d[76] ^ d[77] ^ d[81] ^ d[82] ^ d[83] ^ d[85] ^ d[87] ^ d[88] ^ d[89] ^ d[90] ^ d[91] ^ d[94] ^ d[96] ^ d[97] ^ d[98] ^ d[103] ^ d[110] ^ d[111] ^ d[112] ^ d[113] ^ d[118] ^ d[119] ^ d[120] ^ d[122] ^ d[123] ^ d[124] ^ d[127] ^ d[130] ^ d[132] ^ d[133] ^ d[135] ^ d[137] ^ d[138] ^ d[143] ^ d[149] ^ d[150] ^ d[152] ^ d[153] ^ d[154] ^ d[156] ^ d[157] ^ d[158] ^ d[159] ^ d[161] ^ d[162] ^ d[163] ^ d[164] ^ d[165] ^ d[168] ^ d[171] ^ d[174] ^ d[175] ^ d[176] ^ d[177] ^ d[178] ^ d[180] ^ d[183] ^ d[185] ^ d[188] ^ d[189] ^ d[191] ^ d[192] ^ d[193] ^ d[195] ^ d[196] ^ d[197] ^ d[199] ^ d[200] ^ d[202] ^ d[203] ^ d[204] ^ d[206] ^ d[207] ^ d[209] ^ d[210] ^ d[212] ^ d[215] ^ d[217] ^ d[219] ^ d[220] ^ d[221] ^ d[222] ^ d[223] ^ d[224] ^ d[225] ^ d[226] ^ d[228] ^ d[230] ^ d[234] ^ d[235] ^ d[240] ^ d[244] ^ d[247] ^ d[248] ^ d[251] ^ d[252] ^ d[253] ^ d[255];
end
endfunction
assign adc_crc_err = (adc_crc == adc_crc_res) ? 1'b0 : 1'b1;
// FSM state register
always @(posedge clk) begin
if (rstn == 1'b0) begin
transfer_state <= 3'h0;
end else begin
transfer_state <= transfer_state_next;
end
end
// FSM next state logic
always @(*) begin
case (transfer_state)
IDLE : begin
transfer_state_next <= (start_transfer_s == 1'b1) ? CS_LOW : IDLE;
end
CS_LOW : begin
transfer_state_next <= CNTRL_LOW;
end
CNTRL_LOW : begin
transfer_state_next <= (width_counter == 4'd3) ? CNTRL_HIGH : CNTRL_LOW;
end
CNTRL_HIGH : begin
transfer_state_next <= (adc_config_enable_d | rd_conv_d) ? CS_HIGH : CNTRL_HIGH;
end
CS_HIGH : begin
transfer_state_next <= (channel_counter == nr_rd_burst || adc_config_enable_d) ? IDLE : CNTRL_LOW;
end
default : begin
transfer_state_next <= IDLE;
end
endcase
end
// data valid for the register access
assign rd_valid_s = (transfer_state == CNTRL_HIGH && rd_conv_d == 1'b1) ? 1'b1 : 1'b0;
assign adc_ctrl_status = (transfer_state == CNTRL_HIGH && (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b1)) ? 1'b1 : 1'b0;
// FSM output logic
assign db_o = wr_data;
assign rd_new_data_s = rd_valid_s & ~rd_valid_d;
always @(posedge clk) begin
rd_data <= ~rd_n ? db_i : rd_data;
rd_valid <= rd_new_data_s;
rd_valid_d <= rd_valid_s;
end
assign adc_status_er_5b = adc_status_0[7:3] | adc_status_1[7:3] | adc_status_2[7:3] | adc_status_3[7:3] | adc_status_4[7:3] | adc_status_5[7:3] | adc_status_6[7:3] | adc_status_7[7:3];
assign adc_status_er = adc_status_er_5b[0] | adc_status_er_5b[1] | adc_status_er_5b[2] | adc_status_er_5b[3] | adc_status_er_5b[4];
assign adc_status = (adc_config_mode == STATUS_HEADER || adc_config_mode == CRC_STATUS) ? (adc_status_er ? 1'b0 : 1'b1) : 1'b1;
// clear adc_crc* signals if the adc_config_mode is STATUS_HEADER or SIMPLE
assign adc_crc = (adc_config_mode == STATUS_HEADER || adc_config_mode == SIMPLE) ? 16'h0 : adc_crc_r;
assign adc_crc_res = (adc_config_mode == STATUS_HEADER || adc_config_mode == SIMPLE) ? 16'h0 : adc_crc_res_r;
assign cs_n = (transfer_state == IDLE) ? 1'b1 : 1'b0;
assign db_t = (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b0) ? 1'b0 : 1'b1;
assign rd_n = (transfer_state == CNTRL_LOW) && (rd_conv_d == 1'b1 || (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b1)) ? 1'b0 : 1'b1;
assign wr_n = (transfer_state == CNTRL_LOW) && (adc_config_enable_d == 1'b1 && adc_config_rd_wr == 1'b0) ? 1'b0 : 1'b1;
endmodule
+105
View File
@@ -0,0 +1,105 @@
###############################################################################
## Copyright (C) 2023 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
# ip
source ../../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip_xilinx.tcl
global VIVADO_IP_LIBRARY
adi_ip_create axi_ad7606x
adi_ip_files axi_ad7606x [list \
"$ad_hdl_dir/library/common/ad_edge_detect.v" \
"$ad_hdl_dir/library/xilinx/common/ad_rst_constr.xdc" \
"$ad_hdl_dir/library/common/ad_rst.v" \
"$ad_hdl_dir/library/common/up_axi.v" \
"$ad_hdl_dir/library/xilinx/common/ad_dcfilter.v" \
"$ad_hdl_dir/library/common/ad_datafmt.v" \
"$ad_hdl_dir/library/common/up_xfer_cntrl.v" \
"$ad_hdl_dir/library/common/up_xfer_status.v" \
"$ad_hdl_dir/library/common/up_clock_mon.v" \
"$ad_hdl_dir/library/common/up_delay_cntrl.v" \
"$ad_hdl_dir/library/common/up_adc_channel.v" \
"$ad_hdl_dir/library/common/up_adc_common.v" \
"$ad_hdl_dir/library/xilinx/common/up_xfer_cntrl_constr.xdc" \
"$ad_hdl_dir/library/xilinx/common/ad_rst_constr.xdc" \
"$ad_hdl_dir/library/xilinx/common/up_xfer_status_constr.xdc" \
"$ad_hdl_dir/library/xilinx/common/up_clock_mon_constr.xdc" \
"axi_ad7606x_16b_pif.v" \
"axi_ad7606x_18b_pif.v" \
"axi_ad7606x.v" ]
adi_ip_properties axi_ad7606x
set_property company_url {https://wiki.analog.com/resources/fpga/docs/axi_ad7606x} [ipx::current_core]
ipx::infer_bus_interface adc_clk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
set reset_intf [ipx::infer_bus_interface adc_reset xilinx.com:signal:reset_rtl:1.0 [ipx::current_core]]
set reset_polarity [ipx::add_bus_parameter "POLARITY" $reset_intf]
set_property value "ACTIVE_HIGH" $reset_polarity
set cc [ipx::current_core]
set_property display_name "AXI AD7606X" $cc
set_property description "AXI AD7606X HDL interface" $cc
## define external_clk port as clock interface
adi_add_bus external_clk slave \
"xilinx.com:signal:clock_rtl:1.0" \
"xilinx.com:signal:clock:1.0" \
[list {"external_clk" "CLK"} ]
adi_set_ports_dependency "external_clk" \
"(spirit:decode(id('MODELPARAM_VALUE.EXTERNAL_CLK')) = 1)" 0
## parameter validation
set_property -dict [list \
"value_format" "bool" \
"value" "true" \
] \
[ipx::get_hdl_parameters EXTERNAL_CLK -of_objects $cc]
## customize XGUI layout
## remove the automatically generated GUI page
ipgui::remove_page -component $cc [ipgui::get_pagespec -name "Page 0" -component $cc]
ipx::save_core $cc
## create a new GUI page
ipgui::add_page -name {AXI AD7606X} -component $cc -display_name {AXI AD7606X}
set page0 [ipgui::get_pagespec -name "AXI AD7606X" -component $cc]
ipgui::add_param -name "EXTERNAL_CLK" -component $cc -parent $page0
set_property -dict [list \
"display_name" "EXTERNAL_CLK" \
"tooltip" "External clock for the ADC" \
"widget" "checkBox" \
] [ipgui::get_guiparamspec -name "EXTERNAL_CLK" -component $cc]
ipgui::add_param -name "DEV_CONFIG" -component $cc -parent $page0
set_property -dict [list \
"widget" "comboBox" \
"display_name" "Device Type Selection" \
] [ipgui::get_guiparamspec -name "DEV_CONFIG" -component $cc]
set_property -dict [list \
"value_validation_type" "pairs" \
"value_validation_pairs" { \
"AD7606B" "0" \
"AD7606C-16" "1" \
"AD7606C-18" "2" \
} \
] [ipx::get_user_parameters DEV_CONFIG -of_objects $cc]
adi_add_auto_fpga_spec_params
## save the modifications
ipx::create_xgui_files $cc
ipx::save_core $cc
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,83 @@
# Definitional proc to organize widgets for parameters.
proc init_gui { IPINST } {
ipgui::add_param $IPINST -name "Component_Name"
#Adding Page
set AXI_AD7606X [ipgui::add_page $IPINST -name "AXI AD7606X"]
set EXTERNAL_CLK [ipgui::add_param $IPINST -name "EXTERNAL_CLK" -parent ${AXI_AD7606X} -widget checkBox]
set_property tooltip {External clock for the ADC} ${EXTERNAL_CLK}
ipgui::add_param $IPINST -name "DEV_CONFIG" -parent ${AXI_AD7606X} -widget comboBox
}
proc update_PARAM_VALUE.ADC_CH_DW { PARAM_VALUE.ADC_CH_DW } {
# Procedure called to update ADC_CH_DW when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.ADC_CH_DW { PARAM_VALUE.ADC_CH_DW } {
# Procedure called to validate ADC_CH_DW
return true
}
proc update_PARAM_VALUE.ADC_N_BITS { PARAM_VALUE.ADC_N_BITS } {
# Procedure called to update ADC_N_BITS when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.ADC_N_BITS { PARAM_VALUE.ADC_N_BITS } {
# Procedure called to validate ADC_N_BITS
return true
}
proc update_PARAM_VALUE.DEV_CONFIG { PARAM_VALUE.DEV_CONFIG } {
# Procedure called to update DEV_CONFIG when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.DEV_CONFIG { PARAM_VALUE.DEV_CONFIG } {
# Procedure called to validate DEV_CONFIG
return true
}
proc update_PARAM_VALUE.EXTERNAL_CLK { PARAM_VALUE.EXTERNAL_CLK } {
# Procedure called to update EXTERNAL_CLK when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.EXTERNAL_CLK { PARAM_VALUE.EXTERNAL_CLK } {
# Procedure called to validate EXTERNAL_CLK
return true
}
proc update_PARAM_VALUE.ID { PARAM_VALUE.ID } {
# Procedure called to update ID when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.ID { PARAM_VALUE.ID } {
# Procedure called to validate ID
return true
}
proc update_MODELPARAM_VALUE.ID { MODELPARAM_VALUE.ID PARAM_VALUE.ID } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.ID}] ${MODELPARAM_VALUE.ID}
}
proc update_MODELPARAM_VALUE.DEV_CONFIG { MODELPARAM_VALUE.DEV_CONFIG PARAM_VALUE.DEV_CONFIG } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.DEV_CONFIG}] ${MODELPARAM_VALUE.DEV_CONFIG}
}
proc update_MODELPARAM_VALUE.ADC_CH_DW { MODELPARAM_VALUE.ADC_CH_DW PARAM_VALUE.ADC_CH_DW } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.ADC_CH_DW}] ${MODELPARAM_VALUE.ADC_CH_DW}
}
proc update_MODELPARAM_VALUE.ADC_N_BITS { MODELPARAM_VALUE.ADC_N_BITS PARAM_VALUE.ADC_N_BITS } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.ADC_N_BITS}] ${MODELPARAM_VALUE.ADC_N_BITS}
}
proc update_MODELPARAM_VALUE.EXTERNAL_CLK { MODELPARAM_VALUE.EXTERNAL_CLK PARAM_VALUE.EXTERNAL_CLK } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.EXTERNAL_CLK}] ${MODELPARAM_VALUE.EXTERNAL_CLK}
}