top5x2_7to1_sdr_rx.v 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) 2012-2015 Xilinx, Inc.
  3. // This design is confidential and proprietary of Xilinx, All Rights Reserved.
  4. //////////////////////////////////////////////////////////////////////////////
  5. // ____ ____
  6. // / /\/ /
  7. // /___/ \ / Vendor: Xilinx
  8. // \ \ \/ Version: 1.2
  9. // \ \ Filename: top5x2_7to1_sdr_rx.v
  10. // / / Date Last Modified: 21JAN2015
  11. // /___/ /\ Date Created: 2SEP2011
  12. // \ \ / \
  13. // \___\/\___\
  14. //
  15. //Device: 7-Series
  16. //Purpose: SDR top level receiver example - 2 channels of 5-bits each
  17. //
  18. //Reference: XAPP585.pdf
  19. //
  20. //Revision History:
  21. // Rev 1.0 - First created (nicks)
  22. // Rev 1.1 - BUFG added to IDELAY reference clock
  23. // Rev 1.2 - Updated format (brandond)
  24. //
  25. //////////////////////////////////////////////////////////////////////////////
  26. //
  27. // Disclaimer:
  28. //
  29. // This disclaimer is not a license and does not grant any rights to the materials
  30. // distributed herewith. Except as otherwise provided in a valid license issued to you
  31. // by Xilinx, and to the maximum extent permitted by applicable law:
  32. // (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL FAULTS,
  33. // AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY,
  34. // INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, OR
  35. // FITNESS FOR ANY PARTICULAR PURPOSE; and (2) Xilinx shall not be liable (whether in contract
  36. // or tort, including negligence, or under any other theory of liability) for any loss or damage
  37. // of any kind or nature related to, arising under or in connection with these materials,
  38. // including for any direct, or any indirect, special, incidental, or consequential loss
  39. // or damage (including loss of data, profits, goodwill, or any type of loss or damage suffered
  40. // as a result of any action brought by a third party) even if such damage or loss was
  41. // reasonably foreseeable or Xilinx had been advised of the possibility of the same.
  42. //
  43. // Critical Applications:
  44. //
  45. // Xilinx products are not designed or intended to be fail-safe, or for use in any application
  46. // requiring fail-safe performance, such as life-support or safety devices or systems,
  47. // Class III medical devices, nuclear facilities, applications related to the deployment of airbags,
  48. // or any other applications that could lead to death, personal injury, or severe property or
  49. // environmental damage (individually and collectively, "Critical Applications"). Customer assumes
  50. // the sole risk and liability of any use of Xilinx products in Critical Applications, subject only
  51. // to applicable laws and regulations governing limitations on product liability.
  52. //
  53. // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE AT ALL TIMES.
  54. //
  55. //////////////////////////////////////////////////////////////////////////////
  56. `timescale 1ps/1ps
  57. module top5x2_7to1_sdr_rx
  58. #(
  59. parameter integer D = 4, // Set the number of outputs per channel to be 5 in this example
  60. parameter integer N = 1, // Set the number of channels to be 2 in this example
  61. parameter DataWidth = 14
  62. )
  63. (
  64. input reset, // reset (active high)
  65. input refclkin, // Reference clock for input delay control
  66. input Locked_i, // Reference clock for input delay control
  67. input clkin1_p,
  68. input clkin1_n, // lvds channel 1 clock input
  69. input [D-1:0] datain1_p,
  70. input [D-1:0] datain1_n, // lvds channel 1 data inputs
  71. input clkin2_p,
  72. input clkin2_n, // lvds channel 2 clock input
  73. input [D-1:0] datain2_p,
  74. input [D-1:0] datain2_n, // lvds channel 2 data inputs
  75. output reg dummy,
  76. output [27:0] dout,
  77. output DivClk_o
  78. // output [DataWidth-1:0] dout
  79. );// Dummy output for test
  80. wire refclkint;
  81. wire rx_mmcm_lckdps;
  82. wire [1:0] rx_mmcm_lckdpsbs;
  83. wire rxclk_div;
  84. wire clkin_p;
  85. wire clkin_n;
  86. wire [D*N-1:0] datain_p;
  87. wire [D*N-1:0] datain_n;
  88. // wire [N*DataWidth-1:0] rxdall;
  89. wire [27:0] rxdall;
  90. wire delay_ready;
  91. wire rx_mmcm_lckd;
  92. IDELAYCTRL icontrol
  93. ( // Instantiate input delay control block
  94. .REFCLK (refclkin),
  95. .RST (~Locked_i),
  96. .RDY (delay_ready)
  97. );
  98. // Input clock and data for 2 channels
  99. assign clkin_p = clkin1_p;
  100. assign clkin_n = clkin1_n;
  101. assign datain_p = datain1_p;
  102. assign datain_n = datain1_n;
  103. assign dout = rxdall;
  104. assign DivClk_o = rxclk_div;
  105. n_x_serdes_1_to_7_mmcm_idelay_sdr
  106. #(
  107. .N (N),
  108. .SAMPL_CLOCK ("BUF_G"),
  109. .PIXEL_CLOCK ("BUF_G"),
  110. .USE_PLL ("TRUE"),
  111. .HIGH_PERFORMANCE_MODE ("FALSE"),
  112. .D (D), // Number of data lines
  113. .CLKIN_PERIOD (40.000), // Set input clock period
  114. .MMCM_MODE (4), // Parameter to set multiplier for MMCM to get VCO in correct operating range. 1 multiplies input clock by 7, 2 multiplies clock by 14, etc
  115. .DIFF_TERM ("TRUE"),
  116. // .DATA_FORMAT ("PER_CLOCK")
  117. .DATA_FORMAT ("PER_CHANL")
  118. ) // PER_CLOCK or PER_CHANL data formatting
  119. ReceiverModule
  120. (
  121. .clkin_p (clkin_p),
  122. .clkin_n (clkin_n),
  123. .datain_p (datain_p),
  124. .datain_n (datain_n),
  125. .enable_phase_detector (1'b0),
  126. .rxclk (),
  127. .idelay_rdy (delay_ready),
  128. .rxclk_div (rxclk_div),
  129. .reset (reset),
  130. .rx_mmcm_lckd (rx_mmcm_lckd),
  131. .rx_mmcm_lckdps (rx_mmcm_lckdps),
  132. .rx_mmcm_lckdpsbs (rx_mmcm_lckdpsbs),
  133. .clk_data (),
  134. .rx_data (rxdall),
  135. .bit_rate_value (16'h0350), // required bit rate value
  136. .bit_time_value (),
  137. .status (),
  138. .debug ()
  139. );
  140. endmodule