Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // file: adc_inputs.v
- // (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved.
- //
- // This file contains confidential and proprietary information
- // of Xilinx, Inc. and is protected under U.S. and
- // international copyright and other intellectual property
- // laws.
- //
- // DISCLAIMER
- // This disclaimer is not a license and does not grant any
- // rights to the materials distributed herewith. Except as
- // otherwise provided in a valid license issued to you by
- // Xilinx, and to the maximum extent permitted by applicable
- // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
- // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
- // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
- // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
- // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
- // (2) Xilinx shall not be liable (whether in contract or tort,
- // including negligence, or under any other theory of
- // liability) for any loss or damage of any kind or nature
- // related to, arising under or in connection with these
- // materials, including for any direct, or any indirect,
- // special, incidental, or consequential loss or damage
- // (including loss of data, profits, goodwill, or any type of
- // loss or damage suffered as a result of any action brought
- // by a third party) even if such damage or loss was
- // reasonably foreseeable or Xilinx had been advised of the
- // possibility of the same.
- //
- // CRITICAL APPLICATIONS
- // Xilinx products are not designed or intended to be fail-
- // safe, or for use in any application requiring fail-safe
- // performance, such as life-support or safety devices or
- // systems, Class III medical devices, nuclear facilities,
- // applications related to the deployment of airbags, or any
- // other applications that could lead to death, personal
- // injury, or severe property or environmental damage
- // (individually and collectively, "Critical
- // Applications"). Customer assumes the sole risk and
- // liability of any use of Xilinx products in Critical
- // Applications, subject only to applicable laws and
- // regulations governing limitations on product liability.
- //
- // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
- // PART OF THIS FILE AT ALL TIMES.
- //----------------------------------------------------------------------------
- // User entered comments
- //----------------------------------------------------------------------------
- // None
- //----------------------------------------------------------------------------
- `timescale 1ps/1ps
- (* CORE_GENERATION_INFO = "adc_inputs,selectio_wiz_v2_0,{component_name=adc_inputs,bus_dir=INPUTS,bus_sig_type=DIFF,bus_io_std=LVDS_25,use_serialization=false,use_phase_detector=false,serialization_factor=4,enable_bitslip=false,enable_train=false,system_data_width=11,bus_in_delay=NONE,bus_out_delay=NONE,clk_sig_type=DIFF,clk_io_std=LVDS_25,clk_buf=BUFIO2,active_edge=BOTH_RISE_FALL,clk_delay=NONE,v6_bus_in_delay=NONE,v6_bus_out_delay=NONE,v6_clk_buf=BUFIO,v6_active_edge=NOT_APP,v6_ddr_alignment=SAME_EDGE_PIPELINED,v6_oddr_alignment=SAME_EDGE,ddr_alignment=NONE,v6_interface_type=NETWORKING,interface_type=NETWORKING,v6_bus_in_tap=0,v6_bus_out_tap=0,v6_clk_io_std=LVCMOS18,v6_clk_sig_type=DIFF}" *)
- module adc_inputs
- // width of the data for the system
- #(parameter sys_w = 11,
- // width of the data for the device
- parameter dev_w = 22)
- (
- // From the system into the device
- input [sys_w-1:0] DATA_IN_FROM_PINS_P,
- input [sys_w-1:0] DATA_IN_FROM_PINS_N,
- output [sys_w-1:0] DATA_IN_TO_DEVICE_A,
- output [sys_w-1:0] DATA_IN_TO_DEVICE_B,
- input CLK_IN_P, // Differential clock from IOB
- input CLK_IN_N,
- output CLK_OUT_A,
- output CLK_OUT_B,
- input CLK_RESET,
- input IO_RESET);
- // Signal declarations
- ////------------------------------
- wire clock_enable = 1'b1;
- // After the buffer
- wire [sys_w-1:0] data_in_from_pins_int;
- // Between the delay and serdes
- wire [sys_w-1:0] data_in_from_pins_delay;
- // Create the clock logic
- IBUFGDS
- #(.IOSTANDARD ("LVDS_25"))
- ibufds_clk_inst
- (.I (CLK_IN_P),
- .IB (CLK_IN_N),
- .O (clk_in_int));
- // Set up the clock for use in the serdes
- BUFIO2 #(
- .DIVIDE_BYPASS ("FALSE"),
- .I_INVERT ("FALSE"),
- .USE_DOUBLER ("FALSE"),
- .DIVIDE (1))
- bufio2_inst
- (.DIVCLK (clk_div),
- .IOCLK (clk_in_int_buf),
- .SERDESSTROBE (),
- .I (clk_in_int)
- );
- // also generated the inverted clock
- BUFIO2
- #(.DIVIDE_BYPASS ("FALSE"),
- .I_INVERT ("TRUE"),
- .USE_DOUBLER ("FALSE"),
- .DIVIDE (1))
- bufio2_inv_inst
- (.DIVCLK (),
- .IOCLK (clk_in_int_inv),
- .SERDESSTROBE (),
- .I (clk_in_int));
- // Buffer up the "divided" copied version of the input clock
- BUFG clkout_buf_inst
- (.O (CLK_OUT),
- .I (clk_div));
- // We have multiple bits- step over every bit, instantiating the required elements
- genvar pin_count;
- generate for (pin_count = 0; pin_count < sys_w; pin_count = pin_count + 1) begin: pins
- // Instantiate the buffers
- ////------------------------------
- // Instantiate a buffer for every bit of the data bus
- IBUFDS
- #(.DIFF_TERM ("FALSE"), // Differential termination
- .IOSTANDARD ("LVDS_25"))
- ibufds_inst
- (.I (DATA_IN_FROM_PINS_P [pin_count]),
- .IB (DATA_IN_FROM_PINS_N [pin_count]),
- .O (data_in_from_pins_int[pin_count]));
- // Pass through the delay
- ////-------------------------------
- assign data_in_from_pins_delay[pin_count] = data_in_from_pins_int[pin_count];
- // Connect the delayed data to the fabric
- ////--------------------------------------
- // DDR register instantation
- IDDR2
- #(.DDR_ALIGNMENT ("NONE"),
- .INIT_Q0 (1'b0),
- .INIT_Q1 (1'b0),
- .SRTYPE ("ASYNC"))
- iddr2_inst
- (.Q0 (DATA_IN_TO_DEVICE_A[pin_count]),
- .Q1 (DATA_IN_TO_DEVICE_B[pin_count]),
- .C0 (clk_in_int_buf),
- .C1 (clk_in_int_inv),
- .CE (clock_enable),
- .D (data_in_from_pins_delay[pin_count]),
- .R (IO_RESET),
- .S (1'b0));
- end
- endgenerate
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement