Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // file: adc_inputs.v
  3. // (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved.
  4. //
  5. // This file contains confidential and proprietary information
  6. // of Xilinx, Inc. and is protected under U.S. and
  7. // international copyright and other intellectual property
  8. // laws.
  9. //
  10. // DISCLAIMER
  11. // This disclaimer is not a license and does not grant any
  12. // rights to the materials distributed herewith. Except as
  13. // otherwise provided in a valid license issued to you by
  14. // Xilinx, and to the maximum extent permitted by applicable
  15. // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
  16. // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
  17. // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
  18. // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
  19. // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
  20. // (2) Xilinx shall not be liable (whether in contract or tort,
  21. // including negligence, or under any other theory of
  22. // liability) for any loss or damage of any kind or nature
  23. // related to, arising under or in connection with these
  24. // materials, including for any direct, or any indirect,
  25. // special, incidental, or consequential loss or damage
  26. // (including loss of data, profits, goodwill, or any type of
  27. // loss or damage suffered as a result of any action brought
  28. // by a third party) even if such damage or loss was
  29. // reasonably foreseeable or Xilinx had been advised of the
  30. // possibility of the same.
  31. //
  32. // CRITICAL APPLICATIONS
  33. // Xilinx products are not designed or intended to be fail-
  34. // safe, or for use in any application requiring fail-safe
  35. // performance, such as life-support or safety devices or
  36. // systems, Class III medical devices, nuclear facilities,
  37. // applications related to the deployment of airbags, or any
  38. // other applications that could lead to death, personal
  39. // injury, or severe property or environmental damage
  40. // (individually and collectively, "Critical
  41. // Applications"). Customer assumes the sole risk and
  42. // liability of any use of Xilinx products in Critical
  43. // Applications, subject only to applicable laws and
  44. // regulations governing limitations on product liability.
  45. //
  46. // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
  47. // PART OF THIS FILE AT ALL TIMES.
  48. //----------------------------------------------------------------------------
  49. // User entered comments
  50. //----------------------------------------------------------------------------
  51. // None
  52. //----------------------------------------------------------------------------
  53.  
  54. `timescale 1ps/1ps
  55.  
  56. (* 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}" *)
  57.  
  58. module adc_inputs
  59.    // width of the data for the system
  60.  #(parameter sys_w = 11,
  61.    // width of the data for the device
  62.    parameter dev_w = 22)
  63.  (
  64.   // From the system into the device
  65.   input  [sys_w-1:0] DATA_IN_FROM_PINS_P,
  66.   input  [sys_w-1:0] DATA_IN_FROM_PINS_N,
  67.   output [sys_w-1:0] DATA_IN_TO_DEVICE_A,
  68.   output [sys_w-1:0] DATA_IN_TO_DEVICE_B,
  69.  
  70.   input              CLK_IN_P,      // Differential clock from IOB
  71.   input              CLK_IN_N,
  72.   output             CLK_OUT_A,
  73.   output             CLK_OUT_B,
  74.   input              CLK_RESET,
  75.   input              IO_RESET);
  76.  
  77.  
  78.   // Signal declarations
  79.   ////------------------------------
  80.   wire               clock_enable = 1'b1;
  81.  
  82.   // After the buffer
  83.   wire   [sys_w-1:0] data_in_from_pins_int;
  84.   // Between the delay and serdes
  85.   wire [sys_w-1:0]  data_in_from_pins_delay;
  86.  
  87.   // Create the clock logic
  88.   IBUFGDS
  89.     #(.IOSTANDARD ("LVDS_25"))
  90.    ibufds_clk_inst
  91.      (.I          (CLK_IN_P),
  92.       .IB         (CLK_IN_N),
  93.       .O          (clk_in_int));
  94.  
  95.   // Set up the clock for use in the serdes
  96.   BUFIO2 #(
  97.       .DIVIDE_BYPASS ("FALSE"),
  98.       .I_INVERT      ("FALSE"),
  99.       .USE_DOUBLER   ("FALSE"),
  100.       .DIVIDE        (1))
  101.    bufio2_inst
  102.      (.DIVCLK       (clk_div),
  103.       .IOCLK        (clk_in_int_buf),
  104.       .SERDESSTROBE (),
  105.       .I            (clk_in_int)
  106.    );
  107.  
  108.   // also generated the inverted clock
  109.   BUFIO2
  110.     #(.DIVIDE_BYPASS ("FALSE"),
  111.       .I_INVERT      ("TRUE"),
  112.       .USE_DOUBLER   ("FALSE"),
  113.       .DIVIDE        (1))
  114.    bufio2_inv_inst
  115.      (.DIVCLK        (),
  116.       .IOCLK        (clk_in_int_inv),
  117.       .SERDESSTROBE (),
  118.       .I            (clk_in_int));
  119.  
  120.  
  121.    // Buffer up the "divided" copied version of the input clock
  122.    BUFG clkout_buf_inst
  123.     (.O (CLK_OUT),
  124.      .I (clk_div));
  125.  
  126.   // We have multiple bits- step over every bit, instantiating the required elements
  127.   genvar pin_count;
  128.   generate for (pin_count = 0; pin_count < sys_w; pin_count = pin_count + 1) begin: pins
  129.  
  130.     // Instantiate the buffers
  131.     ////------------------------------
  132.     // Instantiate a buffer for every bit of the data bus
  133.     IBUFDS
  134.       #(.DIFF_TERM  ("FALSE"),             // Differential termination
  135.         .IOSTANDARD ("LVDS_25"))
  136.      ibufds_inst
  137.        (.I          (DATA_IN_FROM_PINS_P  [pin_count]),
  138.         .IB         (DATA_IN_FROM_PINS_N  [pin_count]),
  139.         .O          (data_in_from_pins_int[pin_count]));
  140.  
  141.  
  142.     // Pass through the delay
  143.     ////-------------------------------
  144.    assign data_in_from_pins_delay[pin_count] = data_in_from_pins_int[pin_count];
  145.  
  146.  
  147.     // Connect the delayed data to the fabric
  148.     ////--------------------------------------
  149.    // DDR register instantation
  150.     IDDR2
  151.      #(.DDR_ALIGNMENT  ("NONE"),
  152.        .INIT_Q0        (1'b0),
  153.        .INIT_Q1        (1'b0),
  154.        .SRTYPE         ("ASYNC"))
  155.      iddr2_inst
  156.       (.Q0             (DATA_IN_TO_DEVICE_A[pin_count]),
  157.        .Q1             (DATA_IN_TO_DEVICE_B[pin_count]),
  158.        .C0             (clk_in_int_buf),
  159.        .C1             (clk_in_int_inv),
  160.        .CE             (clock_enable),
  161.        .D              (data_in_from_pins_delay[pin_count]),
  162.        .R              (IO_RESET),
  163.        .S              (1'b0));
  164.  
  165.   end
  166.   endgenerate
  167.  
  168.  
  169.  
  170. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement